<?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 many time a string occurs in a transaction and not the number of events that string appear in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377939#M110815</link>
    <description>&lt;P&gt;ohhh yeah that explains... I thought it's just one set of semicolons, your regex should be something like this then : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "FAILURE_LEVEL;([^;]+;)+(?&amp;lt;failed&amp;gt;.+OK);" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The rest should work fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2019 10:03:09 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-20T10:03:09Z</dc:date>
    <item>
      <title>How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377926#M110802</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've got a machine splitted in two unit A and B who gave me their state of preparation and their Failure level. I wanted to count the number of failure per unit when the unit is ready.&lt;/P&gt;

&lt;P&gt;So, i created a transaction to group my event when my machine is ready and tried to count the number of time my machine wasn't OK, but every query i tried return me the number of event and not the number of time the string i was looking for occurs.&lt;/P&gt;

&lt;P&gt;This is my base search :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index="index1") Equipement="Machine1" (New_State=ready OR New_State=Not_ready  OR id ="*Machine1_B_FAILURE_LEVEL" OR id ="*Machine_A_FAILURE_LEVEL") | transaction Equipement host startswith="New_State="Ready" endswith="New_State=Not_ready"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I tried : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; stats count  by Equipement, New_State limit=100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And  :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   |eval Failure_machine1_A=if(searchmatch(".*machine1_A_FAILURE_LEVEL") AND (searchmatch("Not_ok"),1,Failure_machine1_A)  | | transaction Equipement host startswith="New_State=Ready" endswith="New_State=Not_ready"
     | stats sum(Failure_machine1_A) by Equipement
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;also : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction Equipement host startswith="New_State=Ready" endswith="New_State=Not_ready"
     |eval Failure_machine1_A=if(searchmatch(".*machine1_A_FAILURE_LEVEL") AND (searchmatch("Not_ok"),1,Failure_machine1_A)  |  stats sum(Failure_machine1_A) by Equipement
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval Failure_machine1_A=if((match(id,".*Machine1_A_FAILURE_LEVEL") AND match(_raw, "NOT_OK" )),1,Failure_machine1_A )| transaction Equipement host startswith="New_State=Ready" endswith="New_State=Not_Ready"|  
stats count(Failure_machine1_A) by Equipement
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the last try : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval Failure_machine1_A=if(like(id,"*Machine1_A_FAILURE_LEVEL") AND New_State=Not_ok,1,Failure_machine1_A )| transaction Equipement host startswith="New_State=Ready endswith="New_State=Not_Ready"|  
stats count(Failure_machine1_A) by Equipement
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried to use some subsearch without success.&lt;/P&gt;

&lt;P&gt;As a beginner, I don't know what I can try next or if I use the right method to achieve my goal.&lt;/P&gt;

&lt;P&gt;Thank you in advance for your answers and sorry for my english.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 14:29:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377926#M110802</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2019-05-17T14:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377927#M110803</link>
      <description>&lt;P&gt;hmm its a bit complex to understand. Are you saying that  these 2 texts -*Machine1_B_FAILURE_LEVEL" OR id ="*Machine_A_FAILURE_LEVEL") are occurring multiple times within a single event?&lt;BR /&gt;
stats will calculate the event count and not the individual count for string occurrence.&lt;BR /&gt;
Can you please confirm and share a snapshot of your events?  &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:37:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377927#M110803</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T00:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377928#M110804</link>
      <description>&lt;P&gt;Yes due to the transaction my events are grouped in one and looks like that : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05/18/2019 17:08:322;SOME STRING;MACHINE1_STATE;READY;
05/18/2019 18:05:355;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;OK;
05/18/2019 18:22:460;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;OK;
05/18/2019 19:48:127;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;NOT_OK;
05/18/2019 21:05:237;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;NOT_OK;
05/18/2019;SOMESTRING;MACHINE1_STATE;NOT_READY;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 May 2019 08:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377928#M110804</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2019-05-19T08:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377929#M110805</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
|  eval payload=" 05/18/2019 17:08:322;SOME STRING;MACHINE1_STATE;READY;
 05/18/2019 18:05:355;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;OK;
 05/18/2019 18:22:460;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;OK;
 05/18/2019 19:48:127;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;NOT_OK;
 05/18/2019 21:05:237;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;NOT_OK;
 05/18/2019;SOMESTRING;MACHINE1_STATE;NOT_READY;"
|  rex field=payload "FAILURE(?&amp;lt;failed&amp;gt;.*)" max_match=0
| eval failed_count=mvcount(failed)
| table failed_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here failed count is coming as 4, is that correct? If so, all you need to do is modify the above query to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;your index&amp;gt;|
    |  rex field=_raw "FAILURE(?&amp;lt;failed&amp;gt;.*)" max_match=0
    | eval failed_count=mvcount(failed)
    | table failed_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 May 2019 08:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377929#M110805</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-05-19T08:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377930#M110806</link>
      <description>&lt;P&gt;Thank for your quick aswer, i'll try this tomorrow because i don't have acces to my splunk instance now.&lt;/P&gt;

&lt;P&gt;In fact what I desire it's when I got multiple transactions like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05/18/2019 17:08:322;SOME STRING;MACHINE1_STATE;READY;
 05/18/2019 18:05:355;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;OK;
 05/18/2019 18:22:460;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;OK;
 05/18/2019 19:48:127;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;NOT_OK;
 05/18/2019 21:05:237;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;NOT_OK;
 05/18/2019;SOMESTRING;MACHINE1_STATE;NOT_READY;

 05/16/2019 10:07:254;SOME STRING;MACHINE1_STATE;READY;
 05/16/2019 11:12:523;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;OK;
 05/16/2019 12:27:520;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;OK;
 05/16/2019 13:58:454;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;NOT_OK;
 05/16/2019 20:23:258;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;NOT_OK;
 05/17/2019 16:07:145;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;OK;
 05/17/2019 16:22:220;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;OK;
 05/17/2019 17:48:235;SOME STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;NOT_OK;
 05/17/2019 23:08:652;SOME STRING;Nameofthemachine_Machine1_B_FAILURE_LEVEL;XXX;NOT_OK;
STRING;Nameofthemachine_Machine1_A_FAILURE_LEVEL;XXX;OK;
 05/17/2019;23:53:232;SOMESTRING;MACHINE1_STATE;NOT_READY;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I got in return :&lt;/P&gt;

&lt;P&gt;Machine1_A_Fail : 3&lt;BR /&gt;
Machine1_B_Fail : 3&lt;/P&gt;

&lt;P&gt;And in fact splunk return :&lt;/P&gt;

&lt;P&gt;Machine1_A_Fail : 2&lt;BR /&gt;
Machine1_B_Fail : 2&lt;/P&gt;

&lt;P&gt;Because he counts the 2 transactions and not the 3 occurrence of the string&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377930#M110806</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2020-09-30T00:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377931#M110807</link>
      <description>&lt;P&gt;Hi, this is doable although we might need some more iterations.&lt;BR /&gt;
I am still not getting your requirements.&lt;BR /&gt;
You say  - Machine1_A_Fail : 3&lt;BR /&gt;
Machine1_B_Fail : 3&lt;/P&gt;

&lt;P&gt;But from your example log immediately above this, I can see machine A fail 4 times , 2nd line,4th line,6th line,8th line and 10th line&lt;BR /&gt;
Machine B fails 4 times - 3rd,5th,7th and 9th line.&lt;BR /&gt;
So on what basis are you expecting count of 3 fail for both machine a and b?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:36:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377931#M110807</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T00:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377932#M110808</link>
      <description>&lt;P&gt;Their is two statement possible :&lt;BR /&gt;
-Ok&lt;BR /&gt;
-Not_ok&lt;/P&gt;

&lt;P&gt;And the statement Not_ok for the machine1_A and machine1_B appear 1 time in the first transaction and 2 time in the second, that's why I wanted to count 3 for each  &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377932#M110808</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2020-09-30T00:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377933#M110809</link>
      <description>&lt;P&gt;Hi @le_barbucheron,&lt;/P&gt;

&lt;P&gt;Try this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index="index1" Equipement="Machine1" (New_State="ready" OR New_State="Not_ready" OR id ="*Machine1_B_FAILURE_LEVEL" OR id ="*Machine_A_FAILURE_LEVEL") 
| transaction Equipement host startswith="New_State=Ready" endswith="New_State=Not_ready"
|rex field=payload "FAILURE_LEVEL;XXX;(?&amp;lt;failed&amp;gt;.*);" max_match=0
|mvexpand failed
|stats count by failed,Equipement, New_State 
|where failed="NOT_OK"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 07:05:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377933#M110809</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-20T07:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377934#M110810</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/68181"&gt;@DavidHourani&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;I tried your query but that returns me no results ,&lt;/P&gt;

&lt;P&gt;and when i modify the query like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|mvexpand New_State
|stats count by Equipement, New_State
 |where New_State="NOT_OK"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thx for your answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Because my failure_level is in the extracted field "New_State", and i'm really bad with REGEX,  that return me again the number of events that field occurs and not the number of occurence of the value "NOT_OK"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377934#M110810</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2020-09-30T00:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377935#M110811</link>
      <description>&lt;P&gt;Hi @Sukisen1981,&lt;/P&gt;

&lt;P&gt;I tried your query and that return me the number of time the string "FAILURE_LEVEL" occurs and that nearly what I wanted  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;How can I modify your query to be more precise on the string searched ?&lt;/P&gt;

&lt;P&gt;thx for your answers &lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 08:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377935#M110811</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2019-05-20T08:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377936#M110812</link>
      <description>&lt;P&gt;you will need the regex for the query to work on the NOT_OK..try with this instead : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |rex field=payload "FAILURE_LEVEL;([^;])+;(?&amp;lt;failed&amp;gt;.*);" max_match=0
 |mvexpand failed
 |stats count by failed,Equipement, New_State 
 |where failed="NOT_OK"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 May 2019 08:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377936#M110812</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-20T08:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377937#M110813</link>
      <description>&lt;P&gt;try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  |  rex field=Name "Nameofthemachine_(?&amp;lt;machine&amp;gt;.*?)_FAILURE_LEVEL;XXX;(?&amp;lt;state&amp;gt;.*);" max_match=0
    | eval x=mvzip(machine,state)
    | mvexpand x
    | fields x
    | rex field=x "(?&amp;lt;machine&amp;gt;.*?),(?&amp;lt;state&amp;gt;.*)" 
    | table machine,state
    | where state ="NOT_OK"
    | stats count by machine
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Before the first rex you need to give your events, like -&lt;BR /&gt;
(index="index1") Equipement="Machine1" (New_State=ready OR New_State=Not_ready  OR id ="*Machine1_B_FAILURE_LEVEL" OR id ="*Machine_A_FAILURE_LEVEL") | transaction Equipement host startswith="New_State="Ready" endswith="New_State=Not_ready" |...apply my code...&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:36:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377937#M110813</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T00:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377938#M110814</link>
      <description>&lt;P&gt;Hi again &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/68181"&gt;@DavidHourani&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;I tested it and again Splunk return me no results, maybe because their is 6 ";" between "Failure_LEVEL" and the state "NOT_OK" like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-04-11 19:08:48.230;2019-04-11 17:08:48.230;2019-04-11 19:08:48.230;Machine1_A_FAILURE_LEVEL;XXX;XXX;XXX;XXX;XXX;XXX;NOT_OK;\x00;\x00;\x00;0;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I tried : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "FAILURE_LEVEL;([^;])+;([^;])+;([^;])+;([^;])+;([^;])+;([^;])+;(?&amp;lt;failed&amp;gt;.*);" max_match=0
  |mvexpand failed
  |stats count by failed,Equipement, New_State 
  |where failed="NOT_OK"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But again no result &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377938#M110814</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2020-09-30T00:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377939#M110815</link>
      <description>&lt;P&gt;ohhh yeah that explains... I thought it's just one set of semicolons, your regex should be something like this then : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "FAILURE_LEVEL;([^;]+;)+(?&amp;lt;failed&amp;gt;.+OK);" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The rest should work fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 10:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377939#M110815</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-20T10:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377940#M110816</link>
      <description>&lt;P&gt;hi @le_barbucheron please try the above and check&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 10:35:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377940#M110816</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-05-20T10:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377941#M110817</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I tried your query and I got not result, but when i use : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  |rex field=_raw "FAILURE_LEVEL;([^;])+;([^;])+;([^;])+;([^;])+;([^;])+;([^;])+;(?&amp;lt;state&amp;gt;.*)" max_match=0
     | table state
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I got the right state in the table&lt;/P&gt;

&lt;P&gt;so now I just got to count the number of time the state I want is in the table&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 11:42:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377941#M110817</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2019-05-20T11:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377942#M110818</link>
      <description>&lt;P&gt;Thank you guys with your help I found the answer ! &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "A_FAILURE_LEVEL;([^;])+;([^;])+;([^;])+;([^;])+;([^;])+;([^;])+;(?&amp;lt;state&amp;gt;.*)" max_match=0
 |mvexpand state
  |stats count by Equipement, state
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and untable/fields - the state i don't want &lt;/P&gt;

&lt;P&gt;Thank you so much for your help  @DavidHourani and @Sukisen1981  !! &lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 12:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377942#M110818</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2019-05-20T12:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377943#M110819</link>
      <description>&lt;P&gt;Awesome please upvote our answers and comments for karma points and accept if possible. Also check my last comment I gave you an improvement for this regex &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 12:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377943#M110819</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-20T12:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How many time a string occurs in a transaction and not the number of events that string appear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377944#M110820</link>
      <description>&lt;P&gt;I tried your regex improvement but i don't know why, this gave me no result,&lt;/P&gt;

&lt;P&gt;Thank you so much again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 12:57:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-many-time-a-string-occurs-in-a-transaction-and-not-the/m-p/377944#M110820</guid>
      <dc:creator>le_barbucheron</dc:creator>
      <dc:date>2019-05-20T12:57:48Z</dc:date>
    </item>
  </channel>
</rss>

