Other Usage

How to filter events with exporttool?


Hi I'm attempting to export a subset of events from an index, but no matter what option I put in the export_search portion of the command line I get nothing exported. Below is a simple example of that I have tried that doesn't work. I get the same results on 4.3.1 and 4.2.5.

 # $SPLUNK_HOME/splunk cmd exporttool \
    $SPLUNK_HOME/var/lib/splunk/_internaldb/db/db_1332952458_1332950725_3/ \
    /tmp/test.csv -csv 'search index=_internal source!="*/splunk-0/var/log/splunk/web_service.log"'
Using logging configuration at $SPLUNK_HOME/etc/log-cmdline.cfg.
no events
Tags (2)


This is an old thread, but maybe someone gets some help from this....

It looks like you can't search in the _raw record of the data, however it is possible to filter on host or some of the other fields created at index time. 

If you look in a non-filtered CSV you will see the syntax for host. The filter for export_search would then be 'host::<hostname>'

Note that exporttool is unsupported, so a better alternative may be ./splunk export which may filter on other terms.

0 Karma


If you paste your search directly into the splunk web interface, do you get the expected results? If so, have you tried running "splunk search" from the cmd line instead of "exporttool"? Do you get the same results as in the GUI?


When I remove 'search' from the beginning of the query, yes the GUI and command line both return the same results. But searching with or without 'search' at the start I still get no results from exporttool.

0 Karma
Get Updates on the Splunk Community!

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...