<?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: how to include search results in python custom alert script in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/how-to-include-search-results-in-python-custom-alert-script/m-p/408932#M7186</link>
    <description>&lt;P&gt;For &lt;STRONG&gt;Custom Alert Actions tokens&lt;/STRONG&gt; you could use this guide:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/AdvancedDev/ModAlertsLog#Pass_search_result_values_to_alert_action_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/AdvancedDev/ModAlertsLog#Pass_search_result_values_to_alert_action_tokens&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Alert/EmailNotificationTokens#Search_metadata_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Alert/EmailNotificationTokens#Search_metadata_tokens&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So in your case if you want to pass some &lt;STRONG&gt;field results&lt;/STRONG&gt; (lets name it Results_To_Pass) and also the &lt;STRONG&gt;sid&lt;/STRONG&gt; of the search, you could put it like this in the UI:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Results: $results.Results_To_Pass$
Search Job: $job.sid$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then the python script would parse this and perform its particular function.&lt;/P&gt;

&lt;P&gt;If you could provide more info it would be great.&lt;/P&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:31:50 GMT</pubDate>
    <dc:creator>jaime_ramirez</dc:creator>
    <dc:date>2020-09-30T01:31:50Z</dc:date>
    <item>
      <title>how to include search results in python custom alert script</title>
      <link>https://community.splunk.com/t5/Alerting/how-to-include-search-results-in-python-custom-alert-script/m-p/408931#M7185</link>
      <description>&lt;P&gt;have a custom alert action scripts which have UI. If I give a fieldname in UI that needs to get value from search result and append to sid. How can I use $results.fieldnme$ or any other solution for this.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 13:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/how-to-include-search-results-in-python-custom-alert-script/m-p/408931#M7185</guid>
      <dc:creator>pranay_adla</dc:creator>
      <dc:date>2019-07-29T13:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to include search results in python custom alert script</title>
      <link>https://community.splunk.com/t5/Alerting/how-to-include-search-results-in-python-custom-alert-script/m-p/408932#M7186</link>
      <description>&lt;P&gt;For &lt;STRONG&gt;Custom Alert Actions tokens&lt;/STRONG&gt; you could use this guide:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/AdvancedDev/ModAlertsLog#Pass_search_result_values_to_alert_action_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/AdvancedDev/ModAlertsLog#Pass_search_result_values_to_alert_action_tokens&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Alert/EmailNotificationTokens#Search_metadata_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Alert/EmailNotificationTokens#Search_metadata_tokens&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So in your case if you want to pass some &lt;STRONG&gt;field results&lt;/STRONG&gt; (lets name it Results_To_Pass) and also the &lt;STRONG&gt;sid&lt;/STRONG&gt; of the search, you could put it like this in the UI:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Results: $results.Results_To_Pass$
Search Job: $job.sid$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then the python script would parse this and perform its particular function.&lt;/P&gt;

&lt;P&gt;If you could provide more info it would be great.&lt;/P&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/how-to-include-search-results-in-python-custom-alert-script/m-p/408932#M7186</guid>
      <dc:creator>jaime_ramirez</dc:creator>
      <dc:date>2020-09-30T01:31:50Z</dc:date>
    </item>
  </channel>
</rss>

