<?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 Guarantee startswith when using keepevicted in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461541#M130175</link>
    <description>&lt;P&gt;Hi Splunk community, I am trying to make a query that returns all transactions for a starting event and ending event that last a certain duration as well as any starting events that don't have an ending event for a specific time range. I attempted to do this by putting keepevicted = true in my transaction but this appears to include some unwanted data as well. I believe the below example will show what I mean:&lt;/P&gt;

&lt;P&gt;The data list is as follows:&lt;BR /&gt;
1. Connection: misc.&lt;BR /&gt;
2. Connection: misc.&lt;BR /&gt;
3. unneeded data&lt;BR /&gt;
4. Connection: lost&lt;BR /&gt;
5. Connection: finding&lt;BR /&gt;
6. Connection: found&lt;BR /&gt;
7.unneeded data&lt;BR /&gt;
8. Connection: lost&lt;BR /&gt;
9. Connection: finding&lt;BR /&gt;
10. Connection: still finding&lt;/P&gt;

&lt;P&gt;My query will be as follows&lt;BR /&gt;
"Connection" | transaction startswith="lost " endswith="found" keepevicted=true&lt;/P&gt;

&lt;P&gt;This will return 3 result transactions, events 1-2, events 4-6, and events 8-10. The last two are the ones I want but the first transaction is unneeded but shows up anyway as a result of keepevicted since they are considered close enough. If I removed keepevicted, I will only receive events 4-6 since 8-10 doesn't have the end event.&lt;/P&gt;

&lt;P&gt;Is there a way I can modify the query so I receive the last two transactions but not the first one? Is it possible that transactions aren't necessary and there are other splunk commands that can get me what I want? &lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2020 19:44:01 GMT</pubDate>
    <dc:creator>gp2</dc:creator>
    <dc:date>2020-02-04T19:44:01Z</dc:date>
    <item>
      <title>Guarantee startswith when using keepevicted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461541#M130175</link>
      <description>&lt;P&gt;Hi Splunk community, I am trying to make a query that returns all transactions for a starting event and ending event that last a certain duration as well as any starting events that don't have an ending event for a specific time range. I attempted to do this by putting keepevicted = true in my transaction but this appears to include some unwanted data as well. I believe the below example will show what I mean:&lt;/P&gt;

&lt;P&gt;The data list is as follows:&lt;BR /&gt;
1. Connection: misc.&lt;BR /&gt;
2. Connection: misc.&lt;BR /&gt;
3. unneeded data&lt;BR /&gt;
4. Connection: lost&lt;BR /&gt;
5. Connection: finding&lt;BR /&gt;
6. Connection: found&lt;BR /&gt;
7.unneeded data&lt;BR /&gt;
8. Connection: lost&lt;BR /&gt;
9. Connection: finding&lt;BR /&gt;
10. Connection: still finding&lt;/P&gt;

&lt;P&gt;My query will be as follows&lt;BR /&gt;
"Connection" | transaction startswith="lost " endswith="found" keepevicted=true&lt;/P&gt;

&lt;P&gt;This will return 3 result transactions, events 1-2, events 4-6, and events 8-10. The last two are the ones I want but the first transaction is unneeded but shows up anyway as a result of keepevicted since they are considered close enough. If I removed keepevicted, I will only receive events 4-6 since 8-10 doesn't have the end event.&lt;/P&gt;

&lt;P&gt;Is there a way I can modify the query so I receive the last two transactions but not the first one? Is it possible that transactions aren't necessary and there are other splunk commands that can get me what I want? &lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 19:44:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461541#M130175</guid>
      <dc:creator>gp2</dc:creator>
      <dc:date>2020-02-04T19:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Guarantee startswith when using keepevicted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461542#M130176</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|makeresults
| eval _raw="1. Connection: misc.
2. Connection: misc.
3. unneeded data
4. Connection: lost
5. Connection: finding
6. Connection: found
7.unneeded data
8. Connection: lost
9. Connection: finding
10. Connection: still finding"
| makemv delim="
" _raw
| stats count by _raw
| sort _raw
`comment("this is your sample, from here, the logic")`
| search "Connection"
| streamstats count(eval(searchmatch("lost"))) as session
| where session &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't use &lt;CODE&gt;transaction&lt;/CODE&gt;. but it works.&lt;/P&gt;

&lt;P&gt;Note that the older the log, the higher it must be.&lt;BR /&gt;
If not, use &lt;CODE&gt;| reverse&lt;/CODE&gt; before &lt;CODE&gt;streamstats&lt;/CODE&gt;. &lt;/P&gt;</description>
      <pubDate>Sat, 08 Feb 2020 02:02:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461542#M130176</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-08T02:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Guarantee startswith when using keepevicted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461543#M130177</link>
      <description>&lt;P&gt;Thanks for the response to4kawa,&lt;/P&gt;

&lt;P&gt;I apologize, I don't think I made my issue clear from the earlier example. I need "Connection: misc" to not appear no matter where it shows up in the data. Using this for the raw instead:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Connection: lost&lt;/LI&gt;
&lt;LI&gt;Connection: finding&lt;/LI&gt;
&lt;LI&gt;Connection: found&lt;/LI&gt;
&lt;LI&gt;Unneeded data&lt;/LI&gt;
&lt;LI&gt;Connection: misc.&lt;/LI&gt;
&lt;LI&gt;Connection: misc.&lt;/LI&gt;
&lt;LI&gt;unneeded data&lt;/LI&gt;
&lt;LI&gt;Connection: lost&lt;/LI&gt;
&lt;LI&gt;Connection: finding&lt;/LI&gt;
&lt;LI&gt;Connection: found&lt;/LI&gt;
&lt;LI&gt;Unneeded Data&lt;/LI&gt;
&lt;LI&gt;Connection: lost&lt;/LI&gt;
&lt;LI&gt;Connection: finding&lt;/LI&gt;
&lt;LI&gt;Connection: still finding"&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Your search returns 1-3 and 5-6 with session as 1, 8-10 with session as 2, and 12-14 with session as 3. My transaction example returns the same as well just because keepevicted seems to keep things very general when it is used. In this case, I would only want 1-3, 8-10, and 12-14&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 23:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461543#M130177</guid>
      <dc:creator>gp2</dc:creator>
      <dc:date>2020-02-10T23:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Guarantee startswith when using keepevicted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461544#M130178</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Connection: lost
Connection: finding
Connection: found
Unneeded data
Connection: misc.
Connection: misc.
unneeded data
Connection: lost
Connection: finding
Connection: found
Unneeded Data
Connection: lost
Connection: finding
Connection: still finding" 
| makemv delim="
" _raw 
| rename _raw as raw 
| mvexpand raw 
| rename raw as _raw
    `comment("this is your sample, from here, the logic")` 
| search "Connection" NOT "misc"
| streamstats count(eval(searchmatch("lost"))) as session 
| where session &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Feb 2020 12:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Guarantee-startswith-when-using-keepevicted/m-p/461544#M130178</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-12T12:12:55Z</dc:date>
    </item>
  </channel>
</rss>

