Knowledge Management

Is there a way to find out how each of the search commands work?

fengl2
Explorer

Is there a way finding how each of the search commands works?
I mean to see the code?

For example, can I know how the convert commands works and edit it for my certain requirement?

Tags (1)
1 Solution

lguinn2
Legend

You can see the code for some commands, but not for all.

You can look at the code in $SPLUNK_HOME/etc/apps/search/bin. And yes, you could change the Python code, but your code would get overwritten in the next Splunk update. So create your own app, copy any script you want to modify, and work with your copy of the script.

If you want, you can writea custom search command. I think that writing your own command would be a better solution that editing an existing command - although I would use an existing script as a starting point. Here is a link to the documentation on writing a Custom Search Command

You will probably want to read this documentation carefully so that you can understand how the existing scripts work.

View solution in original post

lguinn2
Legend

You can see the code for some commands, but not for all.

You can look at the code in $SPLUNK_HOME/etc/apps/search/bin. And yes, you could change the Python code, but your code would get overwritten in the next Splunk update. So create your own app, copy any script you want to modify, and work with your copy of the script.

If you want, you can writea custom search command. I think that writing your own command would be a better solution that editing an existing command - although I would use an existing script as a starting point. Here is a link to the documentation on writing a Custom Search Command

You will probably want to read this documentation carefully so that you can understand how the existing scripts work.

fengl2
Explorer

Many thanks!it's really helpful.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...