<?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 return count of certain text using  splunk regular expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/645002#M223373</link>
    <description>&lt;P&gt;Luckily each test segment is delimited by comma. &amp;nbsp;You can use that to break the raw input into individual events, like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval data = split(_raw, ",")
| mvexpand data
| rename data AS _raw
| extract&lt;/LI-CODE&gt;&lt;P&gt;Ultimately, though, your developer should consider breaking the events in raw logs.&lt;/P&gt;&lt;P&gt;Below is data emulation you can play with and compare with your real data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw = "code =test1  description=test1 description status = pending,code =test2  description=test2 description status = COMPLTED, code =test3  description=test3 description status = COMPLETED_FIRST,code =test2  description=test2 description status = COMPLTE."
``` data emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2023 07:31:19 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-05-30T07:31:19Z</dc:date>
    <item>
      <title>How to return count of certain text using  Splunk regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644923#M223334</link>
      <description>&lt;P&gt;I have an input string&amp;nbsp; which contains strings like code =test1&amp;nbsp; description=test1 description status = pending,code =test2&amp;nbsp; description=test2 description status = COMPLTED,&amp;nbsp;code =test3&amp;nbsp; description=test3 description status = COMPLETED_FIRST,code =test2&amp;nbsp; description=test2 description status = COMPLTED,&lt;/P&gt;
&lt;P&gt;Expected Ouput&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code&amp;nbsp; &amp;nbsp;count&amp;nbsp;&lt;/P&gt;
&lt;P&gt;test2&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;
&lt;P&gt;test3&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;Basically i&amp;nbsp; am looking for whose status is completed or starts with completed word&amp;nbsp; those code name and completion count in the result. Can anyone please help me on this.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 03:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644923#M223334</guid>
      <dc:creator>ABHAYA</dc:creator>
      <dc:date>2023-05-30T03:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to return count of certain text using  splunk regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644927#M223336</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254969"&gt;@ABHAYA&lt;/a&gt;.,&lt;/P&gt;&lt;P&gt;if you want to know only the codes where the status is "COMPLETED", you could run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index status=COMPLETED
| stats count BY Code&lt;/LI-CODE&gt;&lt;P&gt;if you want also add all the information about status, you could run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| stats count BY Code status&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 12:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644927#M223336</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-05-29T12:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to return count of certain text using  splunk regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644932#M223340</link>
      <description>&lt;P&gt;&lt;SPAN&gt;code =test1&amp;nbsp; description=test1 description status = pending,code =test2&amp;nbsp; description=test2 description status = COMPLTED,&amp;nbsp;code =test3&amp;nbsp; description=test3 description status = COMPLETED_FIRST,code =test2&amp;nbsp; description=test2 description status = COMPLTE. This&amp;nbsp; input is a single string. I do not have&amp;nbsp; data in table format.I tried with the solution provided by you .it is not working&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 13:19:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644932#M223340</guid>
      <dc:creator>ABHAYA</dc:creator>
      <dc:date>2023-05-29T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to return count of certain text using  splunk regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644936#M223343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254969"&gt;@ABHAYA&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you have all the fields in the same event, you have to divide it using something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="code =test1  description=test1 description status = pending,code =test2  description=test2 description status = COMPLTED, code =test3  description=test3 description status = COMPLETED_FIRST,code =test2  description=test2 description status = COMPLTE."
| rex max_match=0 "(?&amp;lt;event&amp;gt;[^,\.]+)"
| mvexpand event
| rex field=event "code\s*\=\s*(?&amp;lt;code&amp;gt;\w*)"
| rex field=event "status\s*\=\s*(?&amp;lt;status&amp;gt;\w*)"
| stats count BY code status&lt;/LI-CODE&gt;&lt;P&gt;when you arrive at the last raw, you can aggregate as you like.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 13:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644936#M223343</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-05-29T13:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to return count of certain text using  splunk regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644938#M223345</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex max_match=0 "code\s*=\s*(?&amp;lt;code&amp;gt;\S+)"
| stats count by code&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 May 2023 13:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/644938#M223345</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-29T13:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to return count of certain text using  splunk regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/645002#M223373</link>
      <description>&lt;P&gt;Luckily each test segment is delimited by comma. &amp;nbsp;You can use that to break the raw input into individual events, like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval data = split(_raw, ",")
| mvexpand data
| rename data AS _raw
| extract&lt;/LI-CODE&gt;&lt;P&gt;Ultimately, though, your developer should consider breaking the events in raw logs.&lt;/P&gt;&lt;P&gt;Below is data emulation you can play with and compare with your real data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw = "code =test1  description=test1 description status = pending,code =test2  description=test2 description status = COMPLTED, code =test3  description=test3 description status = COMPLETED_FIRST,code =test2  description=test2 description status = COMPLTE."
``` data emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 07:31:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-count-of-certain-text-using-Splunk-regular/m-p/645002#M223373</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-30T07:31:19Z</dc:date>
    </item>
  </channel>
</rss>

