Getting Data In

 


Configure indexed field extraction

About default fields (host, source, sourcetype, and more)

About default fields (host, source, sourcetype, and more)

When Splunk indexes data, it tags each event with a number of fields. These fields become part of the index's event data. The fields that Splunk adds automatically are known as default fields.

Default fields serve a number of purposes. For example, the default field index identifies the index in which the event is located. The default field linecount describes the number of lines the event contains, and timestamp specifies the time at which the event occurred. Splunk uses the values in some of the fields, particularly sourcetype, when indexing the data, in order to create events properly. Once the data has been indexed, you can use the default fields in your searches.

Here's the complete list of default fields:

Type of field List of fields Description
Internal fields _raw, _time, _indextime These fields contain information that Splunk uses for its internal processes.
Basic default fields host, index, linecount, punct, source, sourcetype, splunk_server, timestamp These fields provide basic information about an event, such as where it originated, what kind of data it contains,what index it's located in, how many lines it contains, and when it occurred.
Default datetime fields date_hour, date_mday, date_minute, date_month, date_second, date_wday, date_year, date_zone These fields provide additional searchable granularity to event timestamps.

Note: Only events that have timestamp information in them as generated by their respective systems will have date_* fields. If an event has a date_* field, it represents the value of time/date directly from the event itself. If you have specified any timezone conversions or changed the value of the time/date at indexing or input time (for example, by setting the timestamp to be the time at index or input time), these fields will not represent that.

For information about default fields from the search perspective, see "Use default fields" in the User manual.

Note: You can also specify additional, custom fields for Splunk to include in the index. See "Create custom fields at index-time" in this chapter.

This topic focuses on three key default fields:

Defining host, source, and sourcetype

The host, source, and sourcetype fields are defined as follows:

Source vs sourcetype

Don't confuse source and sourcetype! They're both default fields, but they're entirely different otherwise:

Events with the same source type can come from different sources. For example, say you're monitoring source=/var/log/messages and receiving direct syslog input from udp:514. If you search sourcetype=linux_syslog, Splunk will return events from both of those sources.

Under what conditions should you override host and sourcetype assignment?

Much of the time, Splunk can automatically identify host and sourcetype values that are both correct and useful. But situations do come up that require you to intervene in this process and provide override values.

Override host assignment

You might want to change your default host assignment when:

For detailed information about hosts, see the chapter "Configure host values".

Override sourcetype assignment

You might want to change your default sourcetype assignment when:

There are also steps you can take to expand the range of source types that Splunk automatically recognizes, or to simply rename source types.

For detailed information about source types, see the chapter "Configure source types".

This documentation applies to the following versions of Splunk: 4.3 , 4.3.1 , 4.3.2 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!