<?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 do you trigger an alert based on a parameter from a different alert? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349338#M6153</link>
    <description>&lt;P&gt;Hi Ponczi1,&lt;BR /&gt;
at first if you haven't any event you canot use _time in mytime, so, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=auth "File has been processed"
| append [ search index=_internal | head 1 | eval mytime=strftime(now(), "%Y-%m-%d")]
| stats values(mytime) AS mytime count
| where count=1
| append [ search index=auth Add.N.Days | rex "&amp;lt;retdate&amp;gt;(?&amp;lt;INDATE&amp;gt;.*)&amp;lt;/retdate&amp;gt;" ]
| where mytime=INDATE
| table mytime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 19 Dec 2017 15:01:36 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-12-19T15:01:36Z</dc:date>
    <item>
      <title>How do you trigger an alert based on a parameter from a different alert?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349337#M6152</link>
      <description>&lt;P&gt;Hello, I am new to Splunk and i have a little problem with making an alert&lt;/P&gt;

&lt;P&gt;So i want to trigger an alert when I don't find any rows before 10:00AM that day&lt;/P&gt;

&lt;P&gt;The search looks like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = auth "File has been processed"
| eval mytime=strftime(_time, "%Y-%m-%d") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it woud be simple if it could trigger every day. Unfortunately i need to check if the day the alert should trigger is in another log (trigger if the date is same)&lt;/P&gt;

&lt;P&gt;To get that date i use that query (INDATE is yyyy-mm-dd)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=auth Add.N.Days |rex "&amp;lt;retdate&amp;gt;(?&amp;lt;INDATE&amp;gt;.*)&amp;lt;/retdate&amp;gt;" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So basically i need to check if first search finds anything until 10:00 AM and if not, then trigger an alert but only if the INDATE is  the same as the "mytime" from first query. Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 13:45:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349337#M6152</guid>
      <dc:creator>Ponczi1</dc:creator>
      <dc:date>2017-12-19T13:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do you trigger an alert based on a parameter from a different alert?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349338#M6153</link>
      <description>&lt;P&gt;Hi Ponczi1,&lt;BR /&gt;
at first if you haven't any event you canot use _time in mytime, so, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=auth "File has been processed"
| append [ search index=_internal | head 1 | eval mytime=strftime(now(), "%Y-%m-%d")]
| stats values(mytime) AS mytime count
| where count=1
| append [ search index=auth Add.N.Days | rex "&amp;lt;retdate&amp;gt;(?&amp;lt;INDATE&amp;gt;.*)&amp;lt;/retdate&amp;gt;" ]
| where mytime=INDATE
| table mytime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 15:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349338#M6153</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-12-19T15:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do you trigger an alert based on a parameter from a different alert?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349339#M6154</link>
      <description>&lt;P&gt;Use this as an alert search. The subsearch will return INDATE as current date when index=auth query doesn't return any results (you need to add proper time range to the subsearch). It'll return &lt;CODE&gt;DummyWillNotMatch&lt;/CODE&gt; if the index=auth has data, so it'll not match with &lt;CODE&gt;Add.N.Days&lt;/CODE&gt;. You alert condition should be &lt;CODE&gt;number of events greater than 0&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=auth Add.N.Days | rex "&amp;lt;retdate&amp;gt;(?&amp;lt;INDATE&amp;gt;.*)&amp;lt;/retdate&amp;gt;" 
| search [search index = auth "File has been processed" | eval INDATE="DummyWillNotMatch" | appendpipe [| stats count | where count=0 | eval INDATE=strftime(now(), "%Y-%m-%d") | stats values(INDATE) as INDATE ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2017 15:49:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349339#M6154</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-19T15:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you trigger an alert based on a parameter from a different alert?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349340#M6155</link>
      <description>&lt;P&gt;Love it! Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 07:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-trigger-an-alert-based-on-a-parameter-from-a/m-p/349340#M6155</guid>
      <dc:creator>Ponczi1</dc:creator>
      <dc:date>2017-12-20T07:11:05Z</dc:date>
    </item>
  </channel>
</rss>

