<?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 send hard coded message as an email from Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707436#M239286</link>
    <description>&lt;P&gt;Alerts are based on searches. Searches do _not_ have to be based on indexes. You could event do a repeated daily search to detect the DST change. But the question is why use Splunk for it in the first place.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Dec 2024 20:41:14 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-12-21T20:41:14Z</dc:date>
    <item>
      <title>How to send hard coded message as an email from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707305#M239244</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I need to send a hard coded message to the users just before every daylight savings of the year saying "Daylight savings is scheduled tomorrow, please be alerted " and i don't want to use any index for the that but just hard coded message. Is it possible to create an alert based on the requirement.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 15:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707305#M239244</guid>
      <dc:creator>devsru</dc:creator>
      <dc:date>2024-12-19T15:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to send hard coded message as an email from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707316#M239248</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults count=365 
| streamstats count 
| eval DayOfYear=strftime(round(relative_time(now(), "-0y@y"))+((count-1)*86400),"%Y-%m-%d") 
| eval FirstOfMonth=strftime(strptime(DayOfYear, "%Y-%m-%d"),"%Y-%m-01") 
| eval Sunday=strftime(relative_time(strptime(FirstOfMonth, "%Y-%m-%d"),"+2w@w0"), "%Y-%m-%d")
| eval Match=if((Sunday=DayOfYear AND (strftime(round(relative_time(now(), "-0y@y"))+((count-1)*86400),"%m")=="03" OR strftime(round(relative_time(now(), "-0y@y"))+((count-1)*86400),"%m")=="11") ),"TRUE","FALSE")
| table _time DayOfYear FirstOfMonth Sunday Match
| search Match=TRUE&lt;/LI-CODE&gt;&lt;P&gt;This search will find the second Sunday of every March and November for the current year.&amp;nbsp; You actually need to identify if today is the day before in order to trigger an alert which you can program to send an email.&lt;/P&gt;&lt;P&gt;There might be easier methods to identify the DST change but my research has not found it yet this morning.&amp;nbsp; Also this assumes the DST change is for the Americas, other portions of the globe may not share the same DST days.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 17:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707316#M239248</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2024-12-19T17:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to send hard coded message as an email from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707317#M239249</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259358"&gt;@devsru&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use makeresults for that:&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval msg="Daylight savings is scheduled tomorrow, please be alerted "&lt;BR /&gt;| fields - _time&lt;/P&gt;&lt;P&gt;Create an cron scheduled alert based on this SPL, triggering when the results are more than 0, and configure the 'Send Email' alert action.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 17:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707317#M239249</guid>
      <dc:creator>luizlimapg</dc:creator>
      <dc:date>2024-12-19T17:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to send hard coded message as an email from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707362#M239263</link>
      <description>&lt;P&gt;Thanks for the query. I need to send an alert a day before daylight savings in europe i.e&amp;nbsp;&lt;SPAN&gt;Sun, Mar 30, 2025 – Sun, Oct 26, 2025&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Could you please tell me how to update this query. Lets say run at 2 PM the day before with the message.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 08:49:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707362#M239263</guid>
      <dc:creator>devsru</dc:creator>
      <dc:date>2024-12-20T08:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to send hard coded message as an email from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707434#M239284</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259358"&gt;@devsru&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Thanks for the query. I need to send an alert a day before daylight savings in europe i.e&amp;nbsp;&lt;SPAN&gt;Sun, Mar 30, 2025 – Sun, Oct 26, 2025&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Could you please tell me how to update this query. Lets say run at 2 PM the day before with the message.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ok - so am I to assume the rule is the 4th Sunday of those months or is this more difficult like the last Sunday of those months.&amp;nbsp; There needs to be a rule or common theme to identify each year in the future, unless a governing body just randomly decides each year then I can't script for that.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Sunday=strftime(relative_time(strptime(FirstOfMonth, "%Y-%m-%d"),"+2w@w0"), "%Y-%m-%d")
| eval Match=if((Sunday=DayOfYear AND (strftime(round(relative_time(now(), "-0y@y"))+((count-1)*86400),"%m")=="03" OR strftime(round(relative_time(now(), "-0y@y"))+((count-1)*86400),"%m")=="11") ),"TRUE","FALSE")&lt;/LI-CODE&gt;&lt;P&gt;The eval for Sunday=... contains '+2w@w0' which indicates the second week&amp;nbsp;@ weekday of 0 which in this case is Sunday (1=Monday, etc....).&lt;/P&gt;&lt;P&gt;The eval for Match= has many AND OR statements but the '==03' and '==11' just needs to be updated to match your month in question.&lt;/P&gt;&lt;P&gt;The entire search I gave you will only identify the two days where DST changes occur.&amp;nbsp; You need to add an additional calculation to say is today or now() the day before either of the DST change results.&amp;nbsp; If TRUE then result == 1, if FALSE then result == 0 (result being any variable name of your choosing).&amp;nbsp; Once you have that search working and verified you can setup an Alert action that results in email delivery if result value &amp;gt; 0.&amp;nbsp; That alert action search can be schedule to run every Saturday for every week.&lt;/P&gt;&lt;P&gt;Set it once and forget about it as it should work year after year.&amp;nbsp; That said good maintenance is to on a reoccurring bases verify the search still matches your local DST rules and that destination mailing list still exists and contains the appropriate user base.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2024 20:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707434#M239284</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2024-12-21T20:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to send hard coded message as an email from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707436#M239286</link>
      <description>&lt;P&gt;Alerts are based on searches. Searches do _not_ have to be based on indexes. You could event do a repeated daily search to detect the DST change. But the question is why use Splunk for it in the first place.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2024 20:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-hard-coded-message-as-an-email-from-Splunk/m-p/707436#M239286</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-12-21T20:41:14Z</dc:date>
    </item>
  </channel>
</rss>

