|
Are there any splunk specific variables exposed to scripted inputs that I could use to navigate to files I distribute with my app? For instance I want to parse a file and use values from it, but don't want to hardcode
I'm looking for something like a
Or similar. Is there anything like this? |
|
You can count on
or to get the path to your file:
If you just want the app name, then:
assuming your script is directly in the app's It important that you calculate your paths relative to the current script location and not Great. I'll go with this to C.Y.A. Not sure how it could be used in a dist environment, but better safe than sorry.
(04 Sep '10, 18:09)
caphrim007
|
|
The environment will typically have $SPLUNK_HOME set to '/opt/splunk' or whatever your local installation path is.
Filename should now contain '/opt/splunk/etc/apps/myapp/local/myscript.conf'. I recommend you compute a path relative to the script location, i.e.,
(04 Sep '10, 16:27)
gkanapathy ♦
I wondered about that, but wasn't sure if that approach would have differing results depending on whether the end-user script was called directly or via ScriptRunner. Though IIRC, the latter would only apply to custom search scripts and not scripted inputs.
(04 Sep '10, 16:46)
southeringtonp ♦
(04 Sep '10, 16:53)
gkanapathy ♦
|
