Other Usage

How to filter events with exporttool?

sam
Explorer

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)

hnorvik
Explorer

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

jt_splunk
Explorer

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?

sam
Explorer

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!

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...

Cloud Platform & Enterprise: Classic Dashboard Export Feature Deprecation

As of Splunk Cloud Platform 9.3.2408 and Splunk Enterprise 9.4, classic dashboard export features are now ...