Splunk® Enterprise

Getting Data In

Download manual as PDF

Splunk Enterprise version 6.x is no longer supported as of October 23, 2019. See the Splunk Software Support Policy for details. For information about upgrading to a supported version, see How to upgrade Splunk Enterprise.
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Download topic as PDF

Override automatic source type assignment

Splunk Enterprise attempts to assign a source type to your data automatically. You can explicitly tell it what source type to assign. You can configure Splunk Enterprise so that it assigns a source type based on either the data input or the data source.

For details on the precedence rules that Splunk Enterprise uses to assign source types to data, read How Splunk assigns source types.

Important: Overrides only work on file and directory inputs. You cannot override the source type on network inputs. Additionally, overrides only affect new data that arrives after you set up the override. To correct the source types of events that have already been indexed, create a tag for the source type instead.

This topic describes how to specify a source type based for data based on its:

Specify source type for an input

You can explicitly assign the source type for data coming from a specific input, such as /var/log/. You do this in either Splunk Web or the inputs.conf configuration file.

Note: While assigning source type by input seems like a simple way to handle things, it isn't very granular--when you use it, Splunk Enterprise assigns the same source type to all data from an input, even if some of the data comes from different sources or hosts. To bypass automatic source type assignment in a more targeted manner, you can arrange for Splunk to assign source types based on the source of the data, as described later in this topic.

Use Splunk Web

When you define a data input in System, you can set a source type value that Splunk Enterprise applies to all incoming data from that input. System gives you the option of picking a source type from a list or entering a unique source type value of your own.

To select a source type for an input, use Splunk System and drill down into the settings for the data input type you want to add. For example, for file inputs:

1. Click System in the upper left-hand corner of Splunk Web.

2. In the Data section of the System pop-up, click Data Inputs.

3. Click Files & Directories.

4. Click the New button to add an input.

5. Check the More settings box.

6. Under the Source type heading, you'll see three dropdown choices for setting the source type:

  • Automatic. With this default setting, Splunk Enterprise automatically selects a source type for the data.
  • From list. Splunk Enterprise presents you with a list of common pretrained source types. See the next section for more information on this option.
  • Manual. If the source type you want isn't in the dropdown list but it still belongs to the set of pretrained source types, you can enter its value manually. You can also manually enter your own source type. This option is described in greater detail below.

Pick a source type from a dropdown list

You can select a source type from a list of the most common pretrained source types:

1. Select From list from the Set the source type dropdown list.

2. Choose a source type from the Select source type from list dropdown list that now appears.

3. Save your input settings.

Splunk Enterprise now assigns your selected source type to all events it indexes for that input.

Note: The dropdown list includes just the most common source types. For the complete list of available pretrained source types, see "List of pretrained sourcetypes".

Manually enter a source type

You can manually enter a source type for data that Splunk Enterprise receives from a particular input:

1. Select Manual from the Set the source type dropdown list.

2. Enter a source type in the Source type field that now appears. This can be either one of Splunk's pretrained source types or a source type of your own.

3. Save your input settings.

Splunk Enterprise now assigns your specified source type to all events it indexes for that input.

Use the inputs.conf configuration file

When you configure an input in inputs.conf, you can specify a source type for the input. Edit inputs.conf in $SPLUNK_HOME/etc/system/local/ or in your own custom application directory in $SPLUNK_HOME/etc/apps/. For information on configuration files in general, see "About configuration files" in the Admin manual.

To specify a source type, include a sourcetype attribute within the stanza for the input. For example:


This example sets the source type to "log4j" for any events coming from your TCP input on port 9995.

Warning: Do not put quotes around the attribute value: sourcetype=log4j, not sourcetype="log4j".

Specify source type for a source

Use props.conf to override automated source type matching and explicitly assign a single source type to all data coming from a specific source.

Edit props.conf in $SPLUNK_HOME/etc/system/local/ or in your own custom application directory in $SPLUNK_HOME/etc/apps/. For information on configuration files in general, see "About configuration files".

Important: If you are forwarding data, and you want to assign a source type for a source, you must do this in props.conf on the forwarder. If you do it in props.conf on the receiver, the override will not take effect.

To override source type assignment, add a stanza for your source to props.conf. In the stanza, identify the source path, using regular expression (regex) syntax for flexibility if necessary. Then specify the source type by including a sourcetype attribute. For example:


This example sets the source type to "anaconda" for events from any sources containing the string /var/log/anaconda.log followed by any number of numeric characters.

Important: Your stanza source path regexes (such as [source::.../web/....log]) should be as specific as possible. Avoid using a regex that ends in "...". For example, don't do this:


This is dangerous. It tells Splunk to process any gzip files in /home/fflanda as "mytype" files rather than gzip files.

It would be much better to write:


Note: For a primer on regular expression syntax and usage, see Regular-Expressions.info. You can test regexes by using them in searches with the rex search command. Splunk also maintains a list of useful third-party tools for writing and testing regular expressions.

Last modified on 02 May, 2016
Why source types matter
Configure rule-based source type recognition

This documentation applies to the following versions of Splunk® Enterprise: 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.14, 6.0.15, 6.1, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.1.12, 6.1.13, 6.1.14

Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

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

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters