Refine your search:

I want to configure a saved search alert to trigger a script contained inside my app. The security measures only allow me to run the script from $SPLUNK_HOME/bin/scripts, making it difficult to ship it with the app.

Is there a workaround for this?

asked 18 Feb '10, 00:13

Leo's gravatar image

Leo ♦
817111
accept rate: 47%

edited 09 Jun '10, 18:44


3 Answers:

The solution would be to put the script inside /etc/apps/[appname]/bin and put the script name in savedsearches.conf:

action.script.filename = myscript.bat

link

answered 18 Feb '10, 00:18

Leo's gravatar image

Leo ♦
817111
accept rate: 47%

edited 18 May '10, 17:06

2

The script should actually be placed directly in /etc/apps/[appname]/bin. Files in a 'script' subdirectory of 'bin' are probably ignored.

(18 May '10, 00:24) ewoo ♦

Actually I'm trying this now on 4.1.3 and it doesn't work when the script is placed in either script or bin directory.

(09 Jun '10, 19:08) Leo ♦

the alert script should be placed in:

$SPLUNK_HOME/etc/apps/<app>/bin/scripts/

The error message you're seeing occurs because splunk first looks in the above app level directory and then falls back to the system level script location $SPLUNK_HOME/bin/scripts/ - if a script is not found at the system level a failure is reported and the system level dir is output.

link

answered 09 Jun '10, 21:44

Ledion%20Bitincka's gravatar image

Ledion Bitincka ♦
1.5k36
accept rate: 35%

Leo, this doesn't appear to work, at least in version 4.1.2. When I create a script (verified executable) in $SPLUNK_HOME/etc/apps/myapp/bin/ and create a scheduled search (also running out of myapps/local/savedsearch.conf) that triggers the script, I still see that Splunk is looking in $SPLUNK_HOME/bin/scripts for the script:

ERROR script - Cannot find script at /home/support/splunk/bin/scripts/myscript.sh

What am I missing to get it to run from my app's bin directory?

link

answered 09 Jun '10, 18:09

the_wolverine's gravatar image

the_wolverine ♦
4.3k5843
accept rate: 50%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×207
×200
×172
×100
×66

Asked: 18 Feb '10, 00:13

Seen: 1,181 times

Last updated: 09 Jun '10, 21:44

Copyright © 2005-2012 Splunk, Inc. All rights reserved.