<?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: Scripted Alert Parameters in a Search Query Using runshellscript in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194629#M12428</link>
    <description>&lt;P&gt;The info_sid is correct. If there are events, the file should be there. If no events, the file won't exist, which may cause that error. Did you confirm the file exists manually?  Also, this is unsupported by Splunk. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Runshellscript"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Runshellscript&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2014 15:13:13 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2014-01-03T15:13:13Z</dc:date>
    <item>
      <title>Scripted Alert Parameters in a Search Query Using runshellscript</title>
      <link>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194626#M12425</link>
      <description>&lt;UL&gt;
&lt;LI&gt;| head 1 | addinfo | runshellscript echo.sh DummyEventNumber DummySearchTerms DummyFullQuery DummySearchName DummyReason DummyURL Deprecated $search_id$&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;works until the last parameter. The output is:&lt;/P&gt;

&lt;P&gt;'/opt/splunk/bin/scripts/echo.sh' 'DummyEventNumber' 'DummySearchTerms' 'DummyFullQuery' 'DummySearchName' 'DummyReason' 'DummyURL' 'Deprecated' '/opt/splunk/var/run/splunk/dispatch/$search_id$/results.csv.gz' ''&lt;/P&gt;

&lt;P&gt;My real script processes the results, so I need to retrieve the search_id (or addinfo | info_sid) to construct the path. Any idea how to materialise the value instead of passing the variable name?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194626#M12425</guid>
      <dc:creator>greich</dc:creator>
      <dc:date>2020-09-28T15:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Alert Parameters in a Search Query Using runshellscript</title>
      <link>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194627#M12426</link>
      <description>&lt;P&gt;You can try a map, since you have a single event result.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| head 1 | addinfo | map search=" runshellscript echo.sh DummyEventNumber DummySearchTerms DummyFullQuery DummySearchName DummyReason DummyURL Deprecated /opt/splunk/var/run/splunk/dispatch/$info_sid$/results.csv.gz"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:35:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194627#M12426</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-01-03T14:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Alert Parameters in a Search Query Using runshellscript</title>
      <link>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194628#M12427</link>
      <description>&lt;P&gt;using this with $search_id$ leads to:&lt;BR /&gt;
Error in 'map': Did not find value for required attribute 'search_id'.&lt;BR /&gt;
and using $info_sid$, it seems to work, but doesn't retrieve the correct search id and the script fails with: ERROR|2014-01-03 15:01:27,063 - exception =[Errno 2] No such file or directory: '/opt/splunk/var/run/splunk/dispatch/1388761284.347923/results.csv.gz'&lt;BR /&gt;
if I execute the first part and copy the search id, then paste it manually in the runshellscript parameters, it works fully, but not with the map.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:34:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194628#M12427</guid>
      <dc:creator>greich</dc:creator>
      <dc:date>2020-09-28T15:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Alert Parameters in a Search Query Using runshellscript</title>
      <link>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194629#M12428</link>
      <description>&lt;P&gt;The info_sid is correct. If there are events, the file should be there. If no events, the file won't exist, which may cause that error. Did you confirm the file exists manually?  Also, this is unsupported by Splunk. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Runshellscript"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Runshellscript&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2014 15:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Scripted-Alert-Parameters-in-a-Search-Query-Using-runshellscript/m-p/194629#M12428</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-01-03T15:13:13Z</dc:date>
    </item>
  </channel>
</rss>

