<?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 change the alert email trigger time format? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160628#M2651</link>
    <description>&lt;P&gt;Hi again! &lt;BR /&gt;
Just letting you know that I've asked our engineering team about this. I discovered that the trigger time you see in an alert email is actually search job metadata. This is accessible at the /search/jobs REST endpoint, if you're curious:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/RESTREF/RESTsearchExamples#search.2Fjobs_GET"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/RESTREF/RESTsearchExamples#search.2Fjobs_GET&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'm still looking into whether the rendered trigger time can be formatted in any other way. It may not be possible at this time, but I'll let you know what I find out. Feel free to let me know if you have further questions.&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2015 16:52:27 GMT</pubDate>
    <dc:creator>frobinson_splun</dc:creator>
    <dc:date>2015-08-04T16:52:27Z</dc:date>
    <item>
      <title>How to change the alert email trigger time format?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160626#M2649</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I set up an alert to send an email when the trigger condition is reached. I receive the email, but the time format is always shown in a 12h format.&lt;/P&gt;

&lt;P&gt;Is there any way to set a 24h format on an alert email?&lt;/P&gt;

&lt;P&gt;Mail example : &lt;/P&gt;

&lt;P&gt;Alert:  My alert name&lt;BR /&gt;
Trigger Time:   10:05:02 on August 03, 2015.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:47:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160626#M2649</guid>
      <dc:creator>internet_team</dc:creator>
      <dc:date>2015-08-04T15:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the alert email trigger time format?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160627#M2650</link>
      <description>&lt;P&gt;Hi, @internet_team,&lt;BR /&gt;
I'm a tech writer at Splunk and I work on alerting documentation. This is an interesting question! I'd like to help. I am looking into an answer and I'll post some information for you soon.&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 16:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160627#M2650</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-08-04T16:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the alert email trigger time format?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160628#M2651</link>
      <description>&lt;P&gt;Hi again! &lt;BR /&gt;
Just letting you know that I've asked our engineering team about this. I discovered that the trigger time you see in an alert email is actually search job metadata. This is accessible at the /search/jobs REST endpoint, if you're curious:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/RESTREF/RESTsearchExamples#search.2Fjobs_GET"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/RESTREF/RESTsearchExamples#search.2Fjobs_GET&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'm still looking into whether the rendered trigger time can be formatted in any other way. It may not be possible at this time, but I'll let you know what I find out. Feel free to let me know if you have further questions.&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 16:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160628#M2651</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-08-04T16:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the alert email trigger time format?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160629#M2652</link>
      <description>&lt;P&gt;The original python script controlling the $trigger_timeHMS$ is sendemail.py in $SPLUNK_HOME/etc/apps/search/bin/&lt;BR /&gt;
For my case, I did the followings,&lt;BR /&gt;
1) make a copy of this sendemail.py to $SPLUNK_HOME/etc/apps/my_app/bin/&lt;BR /&gt;
2)  modify the following line&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ssContent['trigger_timeHMS'] = time.strftime("%I:%M:%S", triggerSeconds)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ssContent['trigger_timeHMS'] = time.strftime("%H:%M:%S %Z", triggerSeconds)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or other time format&lt;BR /&gt;
3) create a new commands.conf in $SPLUNK_HOME/etc/apps/my_app/local/ and copy the [sendemail] section from $SPLUNK_HOME/etc/apps/search/default/commands.conf&lt;BR /&gt;
[sendemail]&lt;BR /&gt;
filename = sendemail.py&lt;BR /&gt;
streaming = false&lt;BR /&gt;
run_in_preview = false&lt;BR /&gt;
passauth = true&lt;BR /&gt;
required_fields =&lt;BR /&gt;
changes_colorder = false&lt;BR /&gt;
supports_rawargs = true&lt;BR /&gt;
undo_scheduler_escaping = true&lt;/P&gt;

&lt;P&gt;4) restart or debug-refresh Splunk to make the configuration effective&lt;BR /&gt;
5) create the alert under my_app and use $trigger_timeHMS$ in your alert email subject or content&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-change-the-alert-email-trigger-time-format/m-p/160629#M2652</guid>
      <dc:creator>chanst2</dc:creator>
      <dc:date>2020-09-29T07:02:08Z</dc:date>
    </item>
  </channel>
</rss>

