<?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 Trouble about Custom alert actions script in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Trouble-about-Custom-alert-actions-script/m-p/538706#M10201</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Splunk version :7.3.3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We are testing the Custom alert action. We copied the files as alert_test from etc/apps/alert_logevent.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then we used the example from &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.3/AdvancedDev/ModAlertsBasicExample" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.3/AdvancedDev/ModAlertsBasicExample&lt;/A&gt;&amp;nbsp; &amp;nbsp; and configurated the&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;alert_actions.conf and the logger.py&amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We set an alert and add the custom alert to the alert . &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And the alert runs &lt;STRONG&gt;every 2 minutes&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The logger example implements a custom alert action that does the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Creates a path to a log file when the alert first fires.&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Writes log messages to the log file when the alert fires.&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;Writes log information to an existing Splunk Enterprise log file&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BUT when we cat the log ,we found that the message as below the :&lt;/P&gt;&lt;P&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.473866 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.474097 got payload: {"app":"search","owner":"admin","result_id":"0","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_0.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%201%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",.................................}&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.615030 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.615210 got payload: {"app":"search","owner":"admin","result_id":"1","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_1.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%202%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",...........................................................}&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761179 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761385 got payload: {"app":"search","owner":"admin","result_id":"0","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_2.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%203%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",...............................................}&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761179 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761385 got payload: {"app":"search","owner":"admin","result_id":"1","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_2.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%203%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",...............................................}&lt;/P&gt;&lt;P&gt;It seems like :&lt;SPAN&gt;The time stamp in the log is not consistent with the time that the alert runs. The time in the log is not written &lt;STRONG&gt;every two minutes&lt;/STRONG&gt;. Sometimes it may take five minutes to write in the log.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 03:21:11 GMT</pubDate>
    <dc:creator>Jim111</dc:creator>
    <dc:date>2021-02-05T03:21:11Z</dc:date>
    <item>
      <title>Trouble about Custom alert actions script</title>
      <link>https://community.splunk.com/t5/Alerting/Trouble-about-Custom-alert-actions-script/m-p/538706#M10201</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Splunk version :7.3.3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We are testing the Custom alert action. We copied the files as alert_test from etc/apps/alert_logevent.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then we used the example from &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.3/AdvancedDev/ModAlertsBasicExample" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.3/AdvancedDev/ModAlertsBasicExample&lt;/A&gt;&amp;nbsp; &amp;nbsp; and configurated the&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;alert_actions.conf and the logger.py&amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We set an alert and add the custom alert to the alert . &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And the alert runs &lt;STRONG&gt;every 2 minutes&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The logger example implements a custom alert action that does the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Creates a path to a log file when the alert first fires.&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Writes log messages to the log file when the alert fires.&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;Writes log information to an existing Splunk Enterprise log file&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BUT when we cat the log ,we found that the message as below the :&lt;/P&gt;&lt;P&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.473866 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.474097 got payload: {"app":"search","owner":"admin","result_id":"0","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_0.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%201%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",.................................}&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.615030 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:08:01&lt;/STRONG&gt;.615210 got payload: {"app":"search","owner":"admin","result_id":"1","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_1.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%202%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",...........................................................}&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761179 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761385 got payload: {"app":"search","owner":"admin","result_id":"0","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_2.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%203%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",...............................................}&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761179 got arguments ['/data/eccom_gao/splunk/etc/apps/alert_log_test/bin/logger.py', '--execute']&lt;BR /&gt;2021-02-05T&lt;STRONG&gt;11:13:01&lt;/STRONG&gt;.761385 got payload: {"app":"search","owner":"admin","result_id":"1","results_file":"/data/eccom_gao/splunk/var/run/splunk/dispatch/scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94/per_result_alert/tmp_2.csv.gz","results_link":"http://056-gj-test01:8000/app/search/search?q=%7Cloadjob%20scheduler__admin__search__RMD5e0e0606133e59cd5_at_1612494480_94%20%7C%20head%203%20%7C%20tail%201&amp;amp;earliest=0&amp;amp;latest=now",...............................................}&lt;/P&gt;&lt;P&gt;It seems like :&lt;SPAN&gt;The time stamp in the log is not consistent with the time that the alert runs. The time in the log is not written &lt;STRONG&gt;every two minutes&lt;/STRONG&gt;. Sometimes it may take five minutes to write in the log.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 03:21:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trouble-about-Custom-alert-actions-script/m-p/538706#M10201</guid>
      <dc:creator>Jim111</dc:creator>
      <dc:date>2021-02-05T03:21:11Z</dc:date>
    </item>
  </channel>
</rss>

