Splunk Notes For Testing
Splunk Notes For Testing
Dont see what youre looking for? Start searching for it. Splunk displays only a
certain number of fields in the UI by default. Hundreds more may be extracted
perfectly. Searching for them brings them to the top.
The Field Discovery switch onit identifies the first 50 fields that match name/value
pairs that it finds in the event data. the Fields sidebar in the UI turns this behavior
on and off. You can see some selected fields (fields that Splunk
selected by default or that you have selected), followed by fields that
Splunk pulled out because they appeared in multiple events. If you click
Edit, Splunk lists more fields that you can add to the group of selected
fields. Clicking any field shows you the top values extracted from your
search results.
For more information on automatic field extraction, see http://splunk.com/goto/
book#auto_fields.
Figure 5-1. Choosing Extract Fields from the Event Options menu starts the
Interactive Field Extractor
The IFX appears in another tab or window in your browser. By entering
the kinds of values you seek (such as a client IP address in web logs),
Splunk generates a regular expression that extracts similar values (this is
especially helpful for the regular expression-challenged among us). You
can test the extraction (to make sure it finds the field youre looking for)
and save it with the name of the field.
Manually Configuring Field Extraction
From Manager Fields Field extractions, you can manually specify regular
expressions to extract fields, which is a more flexible but advanced
method for extracting fields. The (This 50 field limit is a default that can be modified
by editing the [kv] stanza in
limits.conf.)
Say you search on sourcetype, a default field that Splunk Enterprise
automatically extracts for every event at index time. If your search is
sourcetype=veeblefetzer
for the past 24 hours, Splunk Enterprise returns every event with a sourcetype of
veeblefetzer in that time range. From this set of events, Splunk Enterprise
automatically extracts the first 50 fields that it can identify on its own. And it
performs extractions of custom fields, based on configuration files. All of these
fields will appear in the fields sidebar when the search is complete.
Now, if a name/value combination like userlogin=fail appears for the first time
25,000 events into the search, and userlogin isn't among the set of custom fields
that you've preconfigured, it likely won't be among the first 50 fields that Splunk
Enterprise finds on its own. However, if you change your search to
sourcetype=veeblefetzer userlogin=*
Then Splunk Enterprise will be smart enough to find and return all events
including both the userlogin field and a sourcetype value of veeblefetzer, and it
will be available in the field sidebar along with the other fields that Splunk
Enterprise has extracted for this search.
Internal
fields
_raw, _time,
_indextime, _cd
_time
Example: Search all sources of type "mail" for mail addressed to the user
"[email protected]", then sorts the search results by timestamp.
sourcetype=mail [email protected] | sort _time