<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pass arguments for shell script in inputs.conf? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496621#M194682</link>
    <description>&lt;P&gt;Thanks @to4kawa to confirm.&lt;/P&gt;

&lt;P&gt;One additional question, can we keep one single addon and enable inputs argumnets based on the server which we deployed?&lt;/P&gt;

&lt;P&gt;Like splunk-addon-shellscript&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;Server1&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argument1"]&lt;BR /&gt;
disabled=0&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argmnet2"]&lt;BR /&gt;
disabled=1&lt;/P&gt;

&lt;P&gt;Server2&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argument1"]&lt;BR /&gt;
disabled=1&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argmnet2"]&lt;BR /&gt;
disabled=0&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 10:22:09 GMT</pubDate>
    <dc:creator>ansif</dc:creator>
    <dc:date>2020-05-13T10:22:09Z</dc:date>
    <item>
      <title>Pass arguments for shell script in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496619#M194680</link>
      <description>&lt;P&gt;How to pass arguments to a script from inputs.conf?&lt;/P&gt;

&lt;P&gt;example:&lt;BR /&gt;
shell_script.sh server1 server2&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 08:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496619#M194680</guid>
      <dc:creator>ansif</dc:creator>
      <dc:date>2020-05-13T08:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pass arguments for shell script in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496620#M194681</link>
      <description>&lt;P&gt;You can write as it is&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 09:50:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496620#M194681</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-13T09:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Pass arguments for shell script in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496621#M194682</link>
      <description>&lt;P&gt;Thanks @to4kawa to confirm.&lt;/P&gt;

&lt;P&gt;One additional question, can we keep one single addon and enable inputs argumnets based on the server which we deployed?&lt;/P&gt;

&lt;P&gt;Like splunk-addon-shellscript&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;Server1&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argument1"]&lt;BR /&gt;
disabled=0&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argmnet2"]&lt;BR /&gt;
disabled=1&lt;/P&gt;

&lt;P&gt;Server2&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argument1"]&lt;BR /&gt;
disabled=1&lt;/P&gt;

&lt;P&gt;[script:abc.sh "argmnet2"]&lt;BR /&gt;
disabled=0&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 10:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496621#M194682</guid>
      <dc:creator>ansif</dc:creator>
      <dc:date>2020-05-13T10:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pass arguments for shell script in inputs.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496622#M194683</link>
      <description>&lt;P&gt;Hello @ansif &lt;/P&gt;

&lt;P&gt;you cannot use parameters in the script stanza. Insted you should use .path format, which is more flexible:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://&amp;lt;cmd&amp;gt;]
* Runs &amp;lt;cmd&amp;gt; at a configured interval (see below) and indexes the output
  that &amp;lt;cmd&amp;gt; returns.
* The &amp;lt;cmd&amp;gt; must reside in one of the following directories:
  * $SPLUNK_HOME/etc/system/bin/
  * $SPLUNK_HOME/etc/apps/$YOUR_APP/bin/
  * $SPLUNK_HOME/bin/scripts/
* The path to &amp;lt;cmd&amp;gt; can be an absolute path, make use of an environment
  variable such as $SPLUNK_HOME, or use the special pattern of an initial '.'
  as the first directory to indicate a location inside the current app.
* The '.' specification must be followed by a platform-specific directory
  separator.
  * For example, on UNIX:
        [script://./bin/my_script.sh]
    Or on Windows:
        [script://.\bin\my_program.exe]
    This '.' pattern is strongly recommended for app developers, and necessary
    for operation in search head pooling environments.
* &amp;lt;cmd&amp;gt; can also be a path to a file that ends with a ".path" suffix. A file
  with this suffix is a special type of pointer file that points to a command
  to be run. Although the pointer file is bound by the same location
  restrictions mentioned above, the command referenced inside it can reside
  anywhere on the file system. The .path file must contain exactly one line:
  the path to the command to run, optionally followed by command-line
  arguments. The file can contain additional empty lines and lines that begin
  with ''. The input ignores these lines.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 12:21:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-arguments-for-shell-script-in-inputs-conf/m-p/496622#M194683</guid>
      <dc:creator>PavelP</dc:creator>
      <dc:date>2020-05-13T12:21:51Z</dc:date>
    </item>
  </channel>
</rss>

