User Manual

 


Search commands

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Search commands

Use search commands to generate search results from an index or process search results that get generated. Combine search commands in a search to produce specific sets of search results. Or produce complex reports based on search results (using the "|" to "pipe"/separate commands).


Select search commands from the list below to learn how to use them.



See the search syntax page for a description of the search command pipeline in modified BNF (Backus - Naur Form).


Data-generating file, remote, run, savedsearch, search
Savingrun, sendemail, outputcsv, outputraw, outputtext, outputxml
Filtering & Re-orderingpage, regex, run, set, sort, uniq, where
Transforming & Reporting associate, chart, contingency, correlate, diff, format, rare, run, select, stats, timechart, top, xmlunescape
Evaluating abstract, addtotals, anomalousvalue, bucket, convert, eval, fields, fillnull, kmeans, outlier, rename, replace, run
Extracting extract(kv), multikv, run, xmlkv
Administeringrun, admin

Use data-generating commands to get data out of a Splunk index.


Saving commands allow you to save data in various formats. Use saving commands to format data for a particular type of output.


Filtering & Re-ordering commands don't change data within results. These commands allow you to filter a result set, and re-order how results appear.


Transforming & Reporting commands allow you to summarize large result sets.


Evaluating commands evaluate each result, and change the fields or values of fields within each result.


Extracting commands add fields to results based on raw event data.


Administering commands allow you to perform administrative functions.




Conventions used in the search reference

Syntax conventions

command argument ... [argument] ...


argument=syntax and value(default value)Description, and usage.

Other conventions

foo | top
./splunk search "foo | top"


The run command

The run command makes calls to external perl or python programs that can modify or generate search results. It takes search results as inputs, and outputs the results of the script(s) called.


To disable the running of a script, delete the script out of the splunk_home/etc/searchscripts directory.


Syntax

run (perl OR python) script-name [script-argument] ... [script-argumentN] [maxinputs-arg]


Arguments

script-name=script name The name of the script to execute (minus the path and file extension).
script-argument=script arguments An argument passed to the script.
maxinputs-arg=maxinputs=integer(100) Specify a number of results to pass to the script. If no maxinputs is specified, run will pass up to 10,000 events to scripts.

Examples

404 | run python myscript myarg1 myarg2 | sendemail to= email@site.com

The admin command

This data-generating command returns the values of a specified ".conf file.


Syntax

admin configuration file


Arguments

configuration file=bundle name Name of a bundle that corresponds to a Splunk .config file (e.g. eventtypes, inputs, props).

Examples

SplunkWeb:


admin eventtypes

CLI:


./splunk search "admin auth"
./splunk search "admin props"

This documentation applies to the following versions of Splunk: 3.0 , 3.0.1 , 3.0.2 , 3.1 , 3.1.1 , 3.1.2 , 3.1.3 , 3.1.4 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.