Splunk® Enterprise

Search Reference

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



Populates the results data structure using the given csv file, which is not modified. The filename must refer to a relative path in $SPLUNK_HOME/var/run/splunk/csv and if the specified file does not exist and the filename did not have an extension, then filename with a .csv extension is assumed. Updates to $SPLUNK_HOME/var/run/csv*.csv using the outputcsv command are not replicated across the cluster.

Note: If you run into an issue with the inputcsv command resulting in an error, make sure that your CSV file ends with a BLANK LINE.


inputcsv [append=<bool>] [start=<int>] [max=<int>] [events=<bool>] <filename>

Required arguments

Syntax: <filename>
Description: Specify the name of the CSV file, located in $SPLUNK_HOME/var/run/splunk/csv.

Optional arguments

Syntax: append=<bool>
Description: Specifies whether the data from the CSV file is appended to the current set of results (true) or replaces the current set of results (false).
Default: false
Syntax: events=<bool>
Description: Allows the imported results to be treated as events so that a proper timeline and fields picker are displayed.
Syntax: max=<int>
Description: Controls the maximum number of events to be read from the file. If max is not specified, there is no limit to the number of events that can be read.
Default: 1000000000 (1 billion)
Syntax: start=<int>
Description: Controls the 0-based offset of the first event to be read.
Default: 0


Example 1: Read in results from the CSV file: "$SPLUNK_HOME/var/run/splunk/csv/all.csv", keep any that contain the string "error", and save the results to the file: "$SPLUNK_HOME/var/run/splunk/csv/error.csv"

| inputcsv all.csv | search error | outputcsv errors.csv

Example 2: Read in events 101 to 600 from either file 'bar' (if exists) or 'bar.csv'.

| inputcsv start=100 max=500 bar

Example 3: Read in events from the CSV file: "$SPLUNK_HOME/var/run/splunk/csv/foo.csv".

| inputcsv foo.csv

See also



Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the inputcsv command.

Last modified on 28 June, 2016

This documentation applies to the following versions of Splunk® Enterprise: 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.2.13, 6.2.14, 6.2.15

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