Getting Data In

Feed inputs as command line argument

the_scissor
Engager

Is it possible to provide inputs to Splunk through command line argument (similar to python for compiling)? Instead of providing the path of the file/directory in inputs.conf, can we provide an input to it using command line argument while running the Splunk binary?
So, if I'll have to search for a string, can I do something like : ./splunk cmd searchtest "string"

inventsekar
SplunkTrust
SplunkTrust

Yes, you can feed inputs using cmd line -
to add a feed of /var/log directory (all files under this directory) -

$SPLUNK_HOME/bin/splunk add monitor /var/log/ 

internally this command updates the inputs.conf file. editing/updating this config file directly will more options.

https://docs.splunk.com/Documentation/Splunk/6.6.1/Data/Configureyourinputs

0 Karma

the_scissor
Engager

Thanks, but that will actually write into the same inputs.conf file and Splunk will be taking inputs from that path. What I was actually asking is whether it is possible to provide an input as command line argument while running the Splunk or not? Like for Python when we compile a file we do $python filename, similarly, can we do something like $splunk filename?

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...