Indexed field case 1 - rare instances of a common term

Let's say your log captures process exit codes. If 1 represents a failure, you probably want to be able to search for this efficiently. Consider a log that looks something like this:

4/1/12 6:35:50.000 PM process=important_process.sh, exitcode=1 

It would be easy to search for this log entry using exitcode=1. The problem is that, when working with extracted fields, the search is effectively reduced to this:

1 | search exitcode="1" 

Since the date contains 1, this search would find every event for the entire day and then filter the events to the few that we are looking for. In contrast, if exitcode were defined as an indexed field, the query would immediately find the events, only retrieving ...

Get Implementing Splunk 7 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.