<?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 Passing a custom string from alert into a script (Python or bash) in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583470#M13445</link>
    <description>&lt;P&gt;I am pretty new to Splunk and trying to figure out how alert notification and adding a script to it works.&lt;/P&gt;&lt;P&gt;My alert will basically return a line from&amp;nbsp; a log stream every time it matches my search criteria, which will be something like this"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;SPAN class=""&gt;process&lt;/SPAN&gt; &lt;SPAN class=""&gt;completed&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;config&lt;/SPAN&gt;&amp;nbsp;some_name&amp;nbsp;&lt;SPAN class=""&gt;having&lt;/SPAN&gt; &lt;SPAN class=""&gt;RUN_ID&lt;/SPAN&gt; &lt;SPAN class=""&gt;1129 (it could be multiple lines)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;my goal is to get the "config_name" part from here and send it as a column name into a sql query that either I put it in a bash or python script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; select "config_name" from table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;how are the alert result and the script&amp;nbsp; connected? can someone bring an example? saw few posts (&lt;A href="https://community.splunk.com/t5/Alerting/how-to-pass-custom-strings-from-a-Splunk-Alert-into-a-python/m-p/322664)" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Alerting/how-to-pass-custom-strings-from-a-Splunk-Alert-into-a-python/m-p/322664)&lt;/A&gt;&amp;nbsp;but not quite getting it....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;any help would be appreciate it!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 03:49:36 GMT</pubDate>
    <dc:creator>moin3949</dc:creator>
    <dc:date>2022-02-03T03:49:36Z</dc:date>
    <item>
      <title>Passing a custom string from alert into a script (Python or bash)</title>
      <link>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583470#M13445</link>
      <description>&lt;P&gt;I am pretty new to Splunk and trying to figure out how alert notification and adding a script to it works.&lt;/P&gt;&lt;P&gt;My alert will basically return a line from&amp;nbsp; a log stream every time it matches my search criteria, which will be something like this"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;SPAN class=""&gt;process&lt;/SPAN&gt; &lt;SPAN class=""&gt;completed&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;config&lt;/SPAN&gt;&amp;nbsp;some_name&amp;nbsp;&lt;SPAN class=""&gt;having&lt;/SPAN&gt; &lt;SPAN class=""&gt;RUN_ID&lt;/SPAN&gt; &lt;SPAN class=""&gt;1129 (it could be multiple lines)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;my goal is to get the "config_name" part from here and send it as a column name into a sql query that either I put it in a bash or python script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; select "config_name" from table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;how are the alert result and the script&amp;nbsp; connected? can someone bring an example? saw few posts (&lt;A href="https://community.splunk.com/t5/Alerting/how-to-pass-custom-strings-from-a-Splunk-Alert-into-a-python/m-p/322664)" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Alerting/how-to-pass-custom-strings-from-a-Splunk-Alert-into-a-python/m-p/322664)&lt;/A&gt;&amp;nbsp;but not quite getting it....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;any help would be appreciate it!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 03:49:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583470#M13445</guid>
      <dc:creator>moin3949</dc:creator>
      <dc:date>2022-02-03T03:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a custom string from alert into a script (Python or bash)</title>
      <link>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583478#M13446</link>
      <description>&lt;P&gt;See &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.4/AdvancedDev/ModAlertsIntro" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.4/AdvancedDev/ModAlertsIntro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Especially the logger.py example.&lt;/P&gt;&lt;P&gt;As a side note - you should never rely on user supplied data like this - don't name the databse query column after a search field.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 06:59:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583478#M13446</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-03T06:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a custom string from alert into a script (Python or bash)</title>
      <link>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583571#M13447</link>
      <description>&lt;P&gt;This doesn't answer my question .this is writing the alert into a log file which is not my intention ...&lt;/P&gt;&lt;P&gt;I want to grab a keyword from the returned string(alert result ) and send it to my custom string.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 14:58:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Passing-a-custom-string-from-alert-into-a-script-Python-or-bash/m-p/583571#M13447</guid>
      <dc:creator>moin3949</dc:creator>
      <dc:date>2022-02-03T14:58:34Z</dc:date>
    </item>
  </channel>
</rss>

