<?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 create alert if there is no data from an extracted field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632643#M219779</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Thank you for your reply. I am trying to understand your search what should I do in my case in the search after the append&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;| append&lt;BR /&gt;[ host1.[abc.local],host2.[abc.local],host3.[abc.local]&lt;BR /&gt;&lt;BR /&gt;| eval found=2 ]&lt;BR /&gt;| stats sum(found) as found by sourcehost&lt;BR /&gt;| where found = 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting error saying "missing a search command before&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 19:23:37 GMT</pubDate>
    <dc:creator>power12</dc:creator>
    <dc:date>2023-02-28T19:23:37Z</dc:date>
    <item>
      <title>How to create alert if there is no data from an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632627#M219768</link>
      <description>&lt;P&gt;Hello Splunkers ,&lt;/P&gt;
&lt;P&gt;I am trying to schedule an alert when there is no data from a particular field which is extracted field from last 30 minutes.&lt;/P&gt;
&lt;P&gt;Below is the sample event&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Feb&lt;/SPAN&gt; &lt;SPAN class=""&gt;28&lt;/SPAN&gt; &lt;SPAN class=""&gt;12:49:25&lt;/SPAN&gt; &lt;SPAN class=""&gt;hostabc&lt;/SPAN&gt; &lt;SPAN class=""&gt;postfix/smtpd&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;61995&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;connect&lt;/SPAN&gt; &lt;SPAN class=""&gt;from&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;host1.abc.local&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;158.xx.xx&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Feb&lt;/SPAN&gt; &lt;SPAN class=""&gt;28&lt;/SPAN&gt; &lt;SPAN class=""&gt;12:49:25&lt;/SPAN&gt; &lt;SPAN class=""&gt;hostxyz&lt;/SPAN&gt; &lt;SPAN class=""&gt;postfix/smtpd&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;61995&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;connect&lt;/SPAN&gt; &lt;SPAN class=""&gt;from&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;host2.abc.local&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;158.xx.xx.xx&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Feb&lt;/SPAN&gt; &lt;SPAN class=""&gt;28&lt;/SPAN&gt; &lt;SPAN class=""&gt;12:49:25&lt;/SPAN&gt; &lt;SPAN class=""&gt;host123&lt;/SPAN&gt; &lt;SPAN class=""&gt;postfix/smtpd&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;61995&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;connect&lt;/SPAN&gt; &lt;SPAN class=""&gt;from&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;host3.abc.local&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;158.xx.xx.xxx&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;I am using below regex to extract sourcehost which gives me&amp;nbsp;&lt;SPAN class=""&gt;host1.abc.local,host2.abc.local,host3.abc.local&lt;/SPAN&gt;&lt;BR /&gt;| rex field=_raw ".*from (?&amp;lt;sourcehost&amp;gt;.*)"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I want to create alert when I dont see any events for the last 30 minutes from the source hosts. The alert should say &lt;STRONG&gt;"No data received from &amp;lt;sourcehos&amp;gt; in the last 30 minutes"&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 18:55:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632627#M219768</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-02-28T18:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create alert if there is no data from an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632635#M219773</link>
      <description>&lt;P&gt;Splunk is good at finding data which is in the logs - it is not so good at finding data which isn't there.&lt;/P&gt;&lt;P&gt;In order to get around this, you need to provide Splunk with a list of everything you are looking for and then see if anything exists in your 30 minute period.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=....
| rex "from (?&amp;lt;sourcehost&amp;gt;.*)"
| dedup sourcehost
| eval found=1
| append
  [ &amp;lt;list of sourcehosts you are looking for&amp;gt;
    | eval found=2 ]
| stats sum(found) as found by sourcehost
| where found = 2
``` found = 1 if only in index, 2 if only in list, 3 if in both ```&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Feb 2023 18:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632635#M219773</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-28T18:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create alert if there is no data from an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632643#M219779</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Thank you for your reply. I am trying to understand your search what should I do in my case in the search after the append&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;| append&lt;BR /&gt;[ host1.[abc.local],host2.[abc.local],host3.[abc.local]&lt;BR /&gt;&lt;BR /&gt;| eval found=2 ]&lt;BR /&gt;| stats sum(found) as found by sourcehost&lt;BR /&gt;| where found = 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting error saying "missing a search command before&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632643#M219779</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-02-28T19:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create alert if there is no data from an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632645#M219781</link>
      <description>&lt;P&gt;You need to append a search which returns a list of sourcehosts you are interested in. Often people will store this list in a csv store and use inputlookup to retreive it&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| append
[ | inputlookup sourcehostlist.csv

| eval found=2 ]
| stats sum(found) as found by sourcehost
| where found = 2&lt;/LI-CODE&gt;&lt;P&gt;or they could append the results of a search with a larger timeframe or a search of a summary index for example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| append
[ search index ... earliest=-10d latest=-1s
| dedup sourcehost
| fields sourcehost

| eval found=2 ]
| stats sum(found) as found by sourcehost
| where found = 2&lt;/LI-CODE&gt;&lt;P&gt;or generate some events by hand each time&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| append
[ | makeresults
  | fields - _time
  | eval sourcehost=split("host1,host1.abc.local,host2,host2.abc.local,host3,host3.abc.local",",")
  | mvexpand sourcehost

| eval found=2 ]
| stats sum(found) as found by sourcehost
| where found = 2&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:36:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632645#M219781</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-28T19:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create alert if there is no data from an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632659#M219789</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Thank you that worked&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 21:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-alert-if-there-is-no-data-from-an-extracted-field/m-p/632659#M219789</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-02-28T21:42:33Z</dc:date>
    </item>
  </channel>
</rss>

