<?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: Searchmatch in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695543#M56996</link>
    <description>&lt;P&gt;That's how case works - it returns the value for the first matching condition. If you want to evaluate all conditions, you have to do three separate evals and assign values to three separate fields.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 12:34:03 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-08-07T12:34:03Z</dc:date>
    <item>
      <title>Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695527#M56986</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I have doing a list of different searches and want the count of each searches.&amp;nbsp;&lt;BR /&gt;So, I was using the searchmatch command but when using it I get only the first result that is successfully searches and it ignore the rest&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;index="abc"&amp;nbsp;&lt;BR /&gt;| eval JobName= case(&lt;BR /&gt;searchmatch("error 1234", Error1),&lt;BR /&gt;searchmatch("error 567", Error2),&lt;BR /&gt;searchmatch("error 89", Error3)&lt;BR /&gt;)&lt;BR /&gt;| stats count by&amp;nbsp;JobName&lt;/P&gt;&lt;P&gt;Output says&amp;nbsp;&lt;BR /&gt;Error1 - 234 (234 is the count of error)&lt;/P&gt;&lt;P&gt;though error 2 and error 3 are there, It is not listing in the results.&amp;nbsp;&lt;BR /&gt;Please could you suggest on how to get this sorted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695527#M56986</guid>
      <dc:creator>suvi6789</dc:creator>
      <dc:date>2024-08-07T10:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695529#M56987</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259662"&gt;@suvi6789&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;parenthesis are wrong and if Error1,2 and3 are strings, use quotes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="abc" 
| eval JobName= case(
searchmatch("error 1234"), "Error1",
searchmatch("error 567"), "Error2",
searchmatch("error 89"), "Error3"
)
| stats count by JobName&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695529#M56987</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-08-07T10:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695531#M56988</link>
      <description>&lt;P&gt;Thanks for the response&lt;BR /&gt;My Bad, the parenthesis are wrong. I have ran the query with the right paranthesis. It was a typo.&lt;/P&gt;&lt;P&gt;index="abc"&amp;nbsp;&lt;BR /&gt;| eval JobName= case(&lt;BR /&gt;searchmatch("error 1234"), "Error1",&lt;BR /&gt;searchmatch("error 567"), "Error2",&lt;BR /&gt;searchmatch("error 89"), "Error3"&lt;BR /&gt;)&lt;BR /&gt;| stats count by&amp;nbsp;JobName&lt;/P&gt;&lt;P&gt;Output says&amp;nbsp;&lt;BR /&gt;Error1 - 234 (234 is the count of error)&lt;/P&gt;&lt;P&gt;though error 2 and error 3 are there, It is not listing in the results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:43:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695531#M56988</guid>
      <dc:creator>suvi6789</dc:creator>
      <dc:date>2024-08-07T10:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695532#M56989</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259662"&gt;@suvi6789&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the search is correct, are you sure about the strings to search for Error 2 and 3?&lt;/P&gt;&lt;P&gt;Only for debugging, please change the order of searchmatch in the eval.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:46:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695532#M56989</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-08-07T10:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695533#M56990</link>
      <description>&lt;P&gt;If I comment&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;index="abc"&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval JobName= case(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;```searchmatch("error 1234"), "Error1",```&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;searchmatch("error 567"), "Error2",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;searchmatch("error 89"), "Error3"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Now, the result is&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Error2 - 125&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695533#M56990</guid>
      <dc:creator>suvi6789</dc:creator>
      <dc:date>2024-08-07T10:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695534#M56991</link>
      <description>&lt;P&gt;Thank you for your response&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I comment the first search&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;index="abc"&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval JobName= case(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;```searchmatch("error 1234"), "Error1",```&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;searchmatch("error 567"), "Error2",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;searchmatch("error 89"), "Error3"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, the result is&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error2 - 125&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695534#M56991</guid>
      <dc:creator>suvi6789</dc:creator>
      <dc:date>2024-08-07T10:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695535#M56992</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259662"&gt;@suvi6789&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Only for test, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="abc" 
| stats 
     count(eval(searchmatch("error 1234"))) AS "Error1"
     count(eval(searchmatch("error 567"))) AS "Error12"
     count(eval(searchmatch("error 89"))) AS "Error3"&lt;/LI-CODE&gt;&lt;P&gt;the issue is probably on the data, you must analyze them&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:52:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695535#M56992</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-08-07T10:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Searchmatch</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695543#M56996</link>
      <description>&lt;P&gt;That's how case works - it returns the value for the first matching condition. If you want to evaluate all conditions, you have to do three separate evals and assign values to three separate fields.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 12:34:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Searchmatch/m-p/695543#M56996</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-07T12:34:03Z</dc:date>
    </item>
  </channel>
</rss>

