<?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: String matches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470502#M192149</link>
    <description>&lt;P&gt;Hi @dustintroop,&lt;BR /&gt;
check how you wrote the eval statement: you need to use AND between conditions and quotes for the all the values.&lt;BR /&gt;
Anyway, you could also have a different approach&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your_search
 | eval Check=if(searchmatch("Fail","Fail","Pass")
 | chart count OVER Device BY Check
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jun 2020 14:37:05 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-06-03T14:37:05Z</dc:date>
    <item>
      <title>String matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470499#M192146</link>
      <description>&lt;P&gt;I have an events for each device with multiple checks as below and i want to find the device count which has "Pass" on all the fields and the device count which has "Fail" in even one field &lt;/P&gt;

&lt;P&gt;Device1  check1: Pass check2: Fail check3: Pass&lt;BR /&gt;
Device2   check1: Pass check2: Pass check3: Pass&lt;BR /&gt;
Device3   check1: Fail   check2: Fail check3: Pass&lt;/P&gt;

&lt;H2&gt;I'm looking something similar to this&lt;/H2&gt;

&lt;P&gt;Healthy_Device_Count =1&lt;BR /&gt;
Un_Healthy_Device_Count=2&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470499#M192146</guid>
      <dc:creator>dustintroop</dc:creator>
      <dc:date>2020-09-30T05:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: String matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470500#M192147</link>
      <description>&lt;P&gt;Hi @dustintroop,&lt;BR /&gt;
you could use eval to identify status events, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| eval Check=if(check1="Pass" AND check2="Pass" AND check3="Pass","Pass","Fail")
| chart count OVER Check BY Device
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 13:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470500#M192147</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-06-03T13:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: String matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470501#M192148</link>
      <description>&lt;P&gt;Thanks Ciao for the Time &amp;amp; Response. I'm getting error that "The arguments in the if function are invalid". Sorry I think i'm not clear in explaining the problem statement. Let me try again.&lt;/P&gt;

&lt;P&gt;Let's say if i have a 100 events from hundred different devices. I want to count the number of events that contains a string "Fail" and the Number of events that doesn't contain the string "Fail"&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 13:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470501#M192148</guid>
      <dc:creator>dustintroop</dc:creator>
      <dc:date>2020-06-03T13:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: String matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470502#M192149</link>
      <description>&lt;P&gt;Hi @dustintroop,&lt;BR /&gt;
check how you wrote the eval statement: you need to use AND between conditions and quotes for the all the values.&lt;BR /&gt;
Anyway, you could also have a different approach&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your_search
 | eval Check=if(searchmatch("Fail","Fail","Pass")
 | chart count OVER Device BY Check
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 14:37:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-matches/m-p/470502#M192149</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-06-03T14:37:05Z</dc:date>
    </item>
  </channel>
</rss>

