<?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 ignore failed seq ids? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371310#M109274</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70281"&gt;@Deepz2612&lt;/a&gt;, based on the data sample provided please find below the run anywhere search. The commands till eval _time are just to mock data. You would need to put the commands from rex afterward to extract &lt;CODE&gt;send&lt;/CODE&gt; and &lt;CODE&gt;receive&lt;/CODE&gt; as &lt;CODE&gt;type&lt;/CODE&gt; and also sequence number as &lt;CODE&gt;seq_id&lt;/CODE&gt;. You need to perform stats to group &lt;CODE&gt;type&lt;/CODE&gt; values by &lt;CODE&gt;seq_id&lt;/CODE&gt;, and then add the search filter as per your need. Following search filter find only the events with single send type.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id \"234567\";11/7/17 8:37:25 PM [INFO] |receive |staring to receive |seq id \"1234567\";11/7/17 8:30:27 PM [INFO] |receive |staring to receive |seq id \"890123\";11/7/17 8:30:27 PM [INFO] |receive |failed:javaException;11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id \"453789\";11/7/17 8:28:30 PM [INFO] |receive |staring to receive |seq id \"567890\";11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id \"123890\";11/7/17 8:20:27 PM [INFO] |receive |failed:javaException" 
| makemv delim=";" data 
| mvexpand data 
| rename data as _raw 
| rex "^(?&amp;lt;_time&amp;gt;\d{1,2}\/\d{1,2}\/\d{2,4}\s\d{1,2}:\d{1,2}:\d{1,2}\s(A|P)M)" 
| eval _time=strptime(_time,"%m/%d/%y %H:%M:%S") 
| rex "\|staring to (?&amp;lt;type&amp;gt;[^\|]+)[\||\s]seq id \"(?&amp;lt;seq_id&amp;gt;[^\"]+)\"" 
| eval type=trim(type) 
| stats count as eventcount earliest(_time) as _time values(type) as type by seq_id 
| search eventcount=1 AND type="send" AND type!="receive"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Once the regular expression is tested with your sample events, you should save the same as &lt;CODE&gt;Fields&lt;/CODE&gt; knowledge object through IFX.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:50:24 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-29T16:50:24Z</dc:date>
    <item>
      <title>How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371305#M109269</link>
      <description>&lt;P&gt;Hello Seniors,&lt;/P&gt;

&lt;P&gt;I have the below log snippet&lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id "234567"&lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |receive |staring to receive |seq id "1234567"&lt;BR /&gt;
11/7/17 8:30:27 PM [INFO] |receive |staring to receive |seq id "890123"&lt;BR /&gt;
11/7/17 8:30:27 PM [INFO] |receive |failed:javaException &lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id "453789"&lt;BR /&gt;
11/7/17 8:28:30 PM [INFO] |receive |staring to receive |seq id "567890"&lt;BR /&gt;
11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id "123890"&lt;BR /&gt;
11/7/17 8:20:27 PM [INFO] |receive |failed:javaException  &lt;/P&gt;

&lt;P&gt;I wanted my results to have the information of the seq ids that are received.So i use the Keyword "receive"&lt;BR /&gt;
But i do not want my result to have seq ids that are failed so my search should first look for the keyword "recieve" and then if is "not" failed in the next event it should be displayed.&lt;BR /&gt;
We just have the clue that the time the seq id start to recieve is same that of the time that it failed. &lt;/P&gt;

&lt;P&gt;eg :&lt;BR /&gt;
&lt;STRONG&gt;11/7/17 8:30:27&lt;/STRONG&gt; PM [INFO] |receive |staring to receive |seq id "890123"&lt;BR /&gt;
&lt;STRONG&gt;11/7/17 8:30:27&lt;/STRONG&gt; PM [INFO] |receive |failed:javaException &lt;/P&gt;

&lt;P&gt;Please help me with this.&lt;BR /&gt;
Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:15:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371305#M109269</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2017-11-15T14:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371306#M109270</link>
      <description>&lt;P&gt;Hi  Deepz2612,&lt;BR /&gt;
try something like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index receive NOT failed
| rex "seq id \"(?&amp;lt;Seq_Id&amp;gt;\d+)"
| table _time Seq_Id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your search could be quicker with field extraction of fields that contain "receive" and "failed".&lt;BR /&gt;
Obviously if you already extracted Seq_Id field, you don't need to use rex command.&lt;BR /&gt;
At the same time it should ne better (I don't know if it's possible for your logs) to use  "staring to receive" instead of "NOT failed".&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371306#M109270</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-11-15T14:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371307#M109271</link>
      <description>&lt;P&gt;Thanks!&lt;BR /&gt;
When i used the above query the seq_id which are failed to receive are also included.&lt;BR /&gt;
But my output should exclude the seq_ids that are failed.&lt;BR /&gt;
In my above log snippet the seq_ids 890123 &amp;amp; 123890 should not be included in my output.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:44:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371307#M109271</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2020-09-29T16:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371308#M109272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;can I get some help on this please.&lt;BR /&gt;
the query suggested fetches me with the seq_id which are failed to receive are also included.&lt;BR /&gt;
But my output should exclude the seq_ids that are failed.&lt;BR /&gt;
In my above log snippet the seq_ids 890123 &amp;amp; 123890 should not be included in my output&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371308#M109272</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2020-09-29T16:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371309#M109273</link>
      <description>&lt;P&gt;Hi Hi Deepz2612,,&lt;BR /&gt;
it's very strange: I ingested your example data and my search extracts only the four correct events, " failed to receive" are excluded from my results.&lt;/P&gt;

&lt;P&gt;my search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=my_sourcetype index=my_index receive NOT failed
 | rex "seq id \"(?&amp;lt;Seq_Id&amp;gt;\d+)"
 | table _time Seq_Id _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                           Seq_Id   _raw
2017-11-07 20:37:25 1234567  11/7/17 8:37:25 PM [INFO] |receive |staring to receive |seq id "1234567"
2017-11-07 20:30:27 890123   11/7/17 8:30:27 PM [INFO] |receive |staring to receive |seq id "890123"
2017-11-07 20:28:30 567890   11/7/17 8:28:30 PM [INFO] |receive |staring to receive |seq id "567890"
2017-11-07 20:20:27 123890   11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id "123890"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 10:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371309#M109273</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-11-18T10:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371310#M109274</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70281"&gt;@Deepz2612&lt;/a&gt;, based on the data sample provided please find below the run anywhere search. The commands till eval _time are just to mock data. You would need to put the commands from rex afterward to extract &lt;CODE&gt;send&lt;/CODE&gt; and &lt;CODE&gt;receive&lt;/CODE&gt; as &lt;CODE&gt;type&lt;/CODE&gt; and also sequence number as &lt;CODE&gt;seq_id&lt;/CODE&gt;. You need to perform stats to group &lt;CODE&gt;type&lt;/CODE&gt; values by &lt;CODE&gt;seq_id&lt;/CODE&gt;, and then add the search filter as per your need. Following search filter find only the events with single send type.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id \"234567\";11/7/17 8:37:25 PM [INFO] |receive |staring to receive |seq id \"1234567\";11/7/17 8:30:27 PM [INFO] |receive |staring to receive |seq id \"890123\";11/7/17 8:30:27 PM [INFO] |receive |failed:javaException;11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id \"453789\";11/7/17 8:28:30 PM [INFO] |receive |staring to receive |seq id \"567890\";11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id \"123890\";11/7/17 8:20:27 PM [INFO] |receive |failed:javaException" 
| makemv delim=";" data 
| mvexpand data 
| rename data as _raw 
| rex "^(?&amp;lt;_time&amp;gt;\d{1,2}\/\d{1,2}\/\d{2,4}\s\d{1,2}:\d{1,2}:\d{1,2}\s(A|P)M)" 
| eval _time=strptime(_time,"%m/%d/%y %H:%M:%S") 
| rex "\|staring to (?&amp;lt;type&amp;gt;[^\|]+)[\||\s]seq id \"(?&amp;lt;seq_id&amp;gt;[^\"]+)\"" 
| eval type=trim(type) 
| stats count as eventcount earliest(_time) as _time values(type) as type by seq_id 
| search eventcount=1 AND type="send" AND type!="receive"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Once the regular expression is tested with your sample events, you should save the same as &lt;CODE&gt;Fields&lt;/CODE&gt; knowledge object through IFX.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:50:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371310#M109274</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T16:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371311#M109275</link>
      <description>&lt;P&gt;@niketnilay thank you so much it worked.&lt;BR /&gt;
but kindly help me with the other question. Suppose if the seq_id that was failed to be received originally was successful on the next two attempts how do I get the result?&lt;BR /&gt;
for say.; &lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id "234567"&lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |receive |staring to receive |seq id "1234567"&lt;BR /&gt;
11/7/17 8:30:27 PM [INFO] |receive |staring to receive |seq id "890123"&lt;BR /&gt;
11/7/17 8:30:27 PM [INFO] |receive |failed:javaException &lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id "453789"&lt;BR /&gt;
11/7/17 8:28:30 PM [INFO] |receive |staring to receive |seq id "567890"&lt;BR /&gt;
11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id "123890"&lt;BR /&gt;
11/7/17 8:20:27 PM [INFO] |receive |failed:javaException &lt;BR /&gt;
11/7/17 9:20:27 PM [INFO] |receive|staring to receive |seq id "&lt;STRONG&gt;123890&lt;/STRONG&gt;"&lt;BR /&gt;
11/7/17 9:37:25 PM [INFO] |Send|staring to send|seq id "234567"&lt;BR /&gt;
11/7/17 9:20:27 PM [INFO] |receive|staring to receive |seq id "&lt;STRONG&gt;123890&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;In the above example seq_id 123890 was originally failed but was received successfully twice after that.&lt;/P&gt;

&lt;P&gt;I tried with calculating the duration between the events and it dint work.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2017 07:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371311#M109275</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2017-11-19T07:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371312#M109276</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70281"&gt;@Deepz2612&lt;/a&gt;, any combination is possible provided you define what is the use case. Based on your original question &lt;CODE&gt;send&lt;/CODE&gt; and &lt;CODE&gt;receive&lt;/CODE&gt; with &lt;CODE&gt;seq_id&lt;/CODE&gt; was supposed to be successful scenario. However above has three receive for 123890 but no send? They should be considered as three failures. &lt;/P&gt;

&lt;P&gt;What are the conditions for seq_id? Will same seq_id be repeated when the receive fails (in other words until it is sent successfully)? Can same seq_id reappear even after the data is sent successfully (i.e. is it really unique id for transaction or more like thread id which gets reused once it is freed)?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371312#M109276</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T16:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371313#M109277</link>
      <description>&lt;P&gt;@Deepz2612, please accept the answer if it has worked, if not please provide further details as requested.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 04:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371313#M109277</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-24T04:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371314#M109278</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt; &lt;BR /&gt;
I wanted to get only the seq_ids that are &lt;STRONG&gt;recieved&lt;/STRONG&gt;.&lt;BR /&gt;
On an attempt to receive a seq_id if it is failed then I should not receive that seq_id.&lt;BR /&gt;
Eg.11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id "123890"&lt;BR /&gt;
11/7/17 8:20:27 PM [INFO] |receive |failed:javaException&lt;BR /&gt;
Your previous response with &lt;STRONG&gt;searchcount=1&lt;/STRONG&gt; worked for this.&lt;BR /&gt;
These seq_is are not unique and so they are possibilities rt that they may be received again.&lt;BR /&gt;
Eg : 11/7/17 8:20:27 PM [INFO] |receive |staring to receive |seq id "&lt;STRONG&gt;123890&lt;/STRONG&gt;"&lt;BR /&gt;
11/7/17 8:20:27 PM [INFO] |receive |failed:javaException &lt;BR /&gt;
11/7/17 8:37:25 PM [INFO] |Send|staring to send|seq id "453789"&lt;BR /&gt;
&lt;STRONG&gt;11/7/17 9:20:27&lt;/STRONG&gt; PM [INFO] |receive|staring to receive |seq id "&lt;STRONG&gt;123890&lt;/STRONG&gt;"&lt;BR /&gt;
&lt;STRONG&gt;11/7/17 10:20:27&lt;/STRONG&gt; PM [INFO] |receive|staring to receive |seq id "&lt;STRONG&gt;123890&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;Now I would want to ignore the sequence id 123890 which has failed @ 8 20 PM.&lt;BR /&gt;
But my results should have the se_id 123890 which were received at 9:20 and 10:20 PM.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371314#M109278</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2020-09-29T16:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore failed seq ids?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371315#M109279</link>
      <description>&lt;P&gt;Should the id 123890 at 11/7/17 10:20:27 &lt;CODE&gt;receive&lt;/CODE&gt; or &lt;CODE&gt;send&lt;/CODE&gt;? Originally you had mentioned received and send as successful, but based on 9:20 and 10:20 data can receive and receive also be successful?&lt;/P&gt;

&lt;P&gt;If seq id is not unique and may be reused, then possibility is you will keep running into orphaned or incorrect transaction. Is it possible to change logging to stitch receive and send with same unique transaction id?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2017 05:28:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-failed-seq-ids/m-p/371315#M109279</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-26T05:28:30Z</dc:date>
    </item>
  </channel>
</rss>

