<?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: alert based on different keywords/sources but from the same index in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359713#M10892</link>
    <description>&lt;P&gt;edited the original answer as well&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 06:32:20 GMT</pubDate>
    <dc:creator>strive</dc:creator>
    <dc:date>2018-03-21T06:32:20Z</dc:date>
    <item>
      <title>alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359704#M10883</link>
      <description>&lt;P&gt;I would like to search for the events from the same index but from different host names. I would like to create a new field names silo based on the host name I would like to name them as silo1 or silo2 by running 1 search instead of 2. Following is the result I am expecting.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4566iD0B150E563D60555/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;How to achieve this is a single search? Please advise&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 20:13:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359704#M10883</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-03-19T20:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359705#M10884</link>
      <description>&lt;P&gt;Can you share the queries that are getting you these results and some examples of the events being returned by them?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 21:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359705#M10884</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-19T21:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359706#M10885</link>
      <description>&lt;P&gt;There are different options based on what your data looks like.  If you really only have 2 hosts then you can do something simple like this.  You can create a new field called silo and then set it to the correct value based on which host the event is from.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=Host1 OR host=Host2 | eval silo=case(host="Silo1Critera", "Silo1", host="Silo2Critera", "Silo2") | stats count, avg(time_taken) by cs_uri_stem, silo 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Mar 2018 23:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359706#M10885</guid>
      <dc:creator>FeatureCreeep</dc:creator>
      <dc:date>2018-03-19T23:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359707#M10886</link>
      <description>&lt;P&gt;I really appreciate your reply. This is same exact way I did initially but I wasn't getting any result.&lt;BR /&gt;
index=iis host=server1 OR host=server3 OR host=server2 OR host=server4 &lt;BR /&gt;
| eval silo=case(host=server1 OR host=server3 , "Silo1", &lt;BR /&gt;
                 host=host=server2 OR host=server4 , "Silo2") &lt;BR /&gt;
| stats count, avg(time_taken) by cs_uri_stem silo&lt;BR /&gt;
| table count silo&lt;/P&gt;

&lt;P&gt;The query I am using now is:&lt;BR /&gt;
index = xyz ( host=server1 OR host=server3)&lt;BR /&gt;
| stats count avg(time_taken) by cs_uri_stem &lt;BR /&gt;
| eval Silo = if(1==1, "Silo1", "NULL") &lt;BR /&gt;
| eval avg(time_taken)=round('avg(time_taken)',2) &lt;BR /&gt;
| append &lt;BR /&gt;
    [ search index = iis ( host=server2 OR host=server4 )&lt;BR /&gt;
    | stats count avg(time_taken) by cs_uri_stem &lt;BR /&gt;
    | eval Silo = if(1==1, "Silo2", "NULL") &lt;BR /&gt;
    | eval avg(time_taken)=round('avg(time_taken)',2)] &lt;BR /&gt;
| table cs_uri_stem count avg(time_taken) Silo&lt;/P&gt;

&lt;P&gt;But this query runs 2 searches, which I would like to avoid 2 searches and implement it in 1 search.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359707#M10886</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2020-09-29T18:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359708#M10887</link>
      <description>&lt;P&gt;index = xyz ( host=server1 OR host=server3)&lt;BR /&gt;
| stats count avg(time_taken) by cs_uri_stem &lt;BR /&gt;
| eval Silo = if(1==1, "Silo1", "NULL") &lt;BR /&gt;
| eval avg(time_taken)=round('avg(time_taken)',2) &lt;BR /&gt;
| append &lt;BR /&gt;
    [ search index = iis ( host=server2 OR host=server4 )&lt;BR /&gt;
    | stats count avg(time_taken) by cs_uri_stem &lt;BR /&gt;
    | eval Silo = if(1==1, "Silo2", "NULL") &lt;BR /&gt;
    | eval avg(time_taken)=round('avg(time_taken)',2)] &lt;BR /&gt;
| table cs_uri_stem count avg(time_taken) Silo&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359708#M10887</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2020-09-29T18:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359709#M10888</link>
      <description>&lt;P&gt;Try this&lt;BR /&gt;
index = xyz &lt;BR /&gt;
| stats count avg(time_taken) by cs_uri_stem, host&lt;BR /&gt;
| eval Silo = case(1==1 AND (host=server1 OR host=server3), "Silo1", 1==1 AND (host=server2 OR host=server3), "Silo2", "NULL") &lt;BR /&gt;
| eval avg(time_taken)=round('avg(time_taken)',2) &lt;BR /&gt;
| table cs_uri_stem count avg(time_taken) Silo&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359709#M10888</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2020-09-29T18:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359710#M10889</link>
      <description>&lt;P&gt;Try this&lt;BR /&gt;
&lt;CODE&gt;index = xyz &lt;BR /&gt;
| stats count avg(time_taken) by cs_uri_stem, host&lt;BR /&gt;
| eval Silo = case(1==1 AND (host=server1 OR host=server3), "Silo1", 1==1 AND (host=server2 OR host=server3), "Silo2", true(), "NULL") &lt;BR /&gt;
| eval avg(time_taken)=round('avg(time_taken)',2) &lt;BR /&gt;
| table cs_uri_stem count avg(time_taken) Silo&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 15:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359710#M10889</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2018-03-20T15:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359711#M10890</link>
      <description>&lt;P&gt;getting the below error. Error in 'eval' command: The arguments to the 'case' function are invalid.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 15:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359711#M10890</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-03-20T15:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359712#M10891</link>
      <description>&lt;P&gt;Modified Search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index = xyz &lt;BR /&gt;
| stats count avg(time_taken) by cs_uri_stem, host&lt;BR /&gt;
| eval Silo = case(1==1 AND (host=server1 OR host=server3), "Silo1", 1==1 AND (host=server2 OR host=server3), "Silo2", true(), "NULL") &lt;BR /&gt;
| eval avg(time_taken)=round('avg(time_taken)',2) &lt;BR /&gt;
| table cs_uri_stem count avg(time_taken) Silo&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Tested similar search locally and works&lt;BR /&gt;
&lt;CODE&gt;index=XYZ | stats count avg(bytes) by column1 | eval Silo = case(1==1 AND column1="CACHE_MISS", "Silo1", 1==1 AND (column1="CACHE_MEM_HIT" OR column1="CACHE_REVALIDATED_MEM_HIT"), "Silo2", true(), "NULL")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 06:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359712#M10891</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2018-03-21T06:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359713#M10892</link>
      <description>&lt;P&gt;edited the original answer as well&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 06:32:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359713#M10892</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2018-03-21T06:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359714#M10893</link>
      <description>&lt;P&gt;I am getting NULL for everything&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 19:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359714#M10893</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-03-21T19:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359715#M10894</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz host=server1 OR host=server2 OR host=server3 OR host=server4
| stats values(host) AS host, count, avg(time_taken) AS avg_time_taken BY cs_uri_stem
| eval Silo=case(host="server1" OR host="server3", "Silo1", host="server2" OR host="server4", "Silo2", 1=1, "SILO NOT FOUND")
| eval avg_time_taken=round(avg_time_taken, 2)
| table cs_uri_stem count avg_time_taken Silo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Mar 2018 19:16:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359715#M10894</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-21T19:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359716#M10895</link>
      <description>&lt;P&gt;That works!&lt;/P&gt;

&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 19:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359716#M10895</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-03-21T19:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359717#M10896</link>
      <description>&lt;P&gt;index=xyz host=server1 OR host=server2 OR host=server3 OR host=server4&lt;BR /&gt;
 | stats values(host) AS host, count, avg(time_taken) AS avg_time_taken BY cs_uri_stem&lt;BR /&gt;
 | eval Silo=case(host="server1" OR host="server3", "Silo1", host="server2" OR host="server4", "Silo2", 1=1, "SILO NOT FOUND")&lt;BR /&gt;
 | eval avg_time_taken=round(avg_time_taken, 2)&lt;BR /&gt;
 | table cs_uri_stem count avg_time_taken Silo&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359717#M10896</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2020-09-29T18:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: alert based on different keywords/sources but from the same index</title>
      <link>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359718#M10897</link>
      <description>&lt;P&gt;You're welcome. I've converted it to an answer.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 19:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/alert-based-on-different-keywords-sources-but-from-the-same/m-p/359718#M10897</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-21T19:43:24Z</dc:date>
    </item>
  </channel>
</rss>

