<?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 do I keep startswith from evicting a previous transaction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146099#M40779</link>
    <description>&lt;P&gt;It's not the endswith that is the problem - I can successfully filter out the incorrect "ends".  I can't filter out the incorrect "starts" because they are identical to each other.  I need to somehow tell &lt;CODE&gt;transaction&lt;/CODE&gt; to ignore repeated starts.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2015 15:52:07 GMT</pubDate>
    <dc:creator>jswarren</dc:creator>
    <dc:date>2015-07-29T15:52:07Z</dc:date>
    <item>
      <title>How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146094#M40774</link>
      <description>&lt;P&gt;Assume I have an input file like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015-07-28 12:00:01 Executing function a...
2015-07-28 12:00:02 debug1
2015-07-28 12:00:03 debug2
2015-07-28 12:00:04 Completing function a (value=-1)
2015-07-28 12:00:05 Executing function a...
2015-07-28 12:00:06 debug3
2015-07-28 12:00:07 debug4
2015-07-28 12:00:08 Completing function a (value=0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to build a transaction object that begins with the first line and ends with the last.  If I use &lt;CODE&gt;startswith="Executing function a..."&lt;/CODE&gt; and &lt;CODE&gt;endswith="Completing function a (value=0)"&lt;/CODE&gt;, it appears that the second &lt;CODE&gt;Executing function a...&lt;/CODE&gt; evicts the first, even though an &lt;CODE&gt;endswith&lt;/CODE&gt; has not occurred.  I end up with a single transaction that begins at 12:00:05 and ends at 12:00:08, and the earlier is an incomplete transaction.&lt;/P&gt;

&lt;P&gt;Is there any way to get &lt;CODE&gt;transaction&lt;/CODE&gt; not to evict the previous transaction when it encounters another &lt;CODE&gt;startswith&lt;/CODE&gt; (prior to an &lt;CODE&gt;endswith&lt;/CODE&gt;)?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 22:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146094#M40774</guid>
      <dc:creator>jswarren</dc:creator>
      <dc:date>2015-07-28T22:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146095#M40775</link>
      <description>&lt;P&gt;Hi jswarren&lt;/P&gt;

&lt;P&gt;I'm not sure if thats the key but your &lt;CODE&gt; endswith="Completing function a &lt;STRONG&gt;(value=0)&lt;/STRONG&gt;" &lt;/CODE&gt;is explicit looking for &lt;CODE&gt;value=0&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;It might be enough to simplify your search to something like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt; ... | transaction startswith="Executing" endswith="Completing" &lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;sincerely&lt;BR /&gt;
hgrow &lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 12:14:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146095#M40775</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2015-07-29T12:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146096#M40776</link>
      <description>&lt;P&gt;If I do that, it results in two transactions, one from 12:00:01 - 12:00:04 and another from 12:00:05 - 12:00:08, which is not the desired outcome.  The explicit "value=0" is requred.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 13:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146096#M40776</guid>
      <dc:creator>jswarren</dc:creator>
      <dc:date>2015-07-29T13:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146097#M40777</link>
      <description>&lt;P&gt;Make sure that 'value' field is extracted, then try the search suggested by @hgrow and filter the incomplete result by checking "| where value=0". This will drop the transaction with value=-1 (incomplete)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 14:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146097#M40777</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-07-29T14:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146098#M40778</link>
      <description>&lt;P&gt;Ah I see ... i've got that wrong. It's a tricky problem ...Im not sure if there is a simple way to not evict the first transaction.&lt;/P&gt;

&lt;P&gt;If i get you right, you want all events from execution function a until Completing with value=0 in one transaction.It all depends on how your other events look like. Is it always function a? Are these events all in order? Maybe what you can try is to reduce your transaction to an &lt;CODE&gt;endswith&lt;/CODE&gt;. &lt;BR /&gt;
Something like &lt;CODE&gt; ...  | transaction endswith="(value=0)"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 15:05:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146098#M40778</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2015-07-29T15:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146099#M40779</link>
      <description>&lt;P&gt;It's not the endswith that is the problem - I can successfully filter out the incorrect "ends".  I can't filter out the incorrect "starts" because they are identical to each other.  I need to somehow tell &lt;CODE&gt;transaction&lt;/CODE&gt; to ignore repeated starts.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 15:52:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146099#M40779</guid>
      <dc:creator>jswarren</dc:creator>
      <dc:date>2015-07-29T15:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146100#M40780</link>
      <description>&lt;P&gt;Answers to your questions: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt; No, it's not always "function a", it could be one of hundreds or thousands of different function names.&lt;/LI&gt;
&lt;LI&gt; Yes, the events are in order and the process that writes the log is single-threaded.&lt;/LI&gt;
&lt;LI&gt; I still have to have some way to identify the start of a transaction.  What other options could I consider?&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 29 Jul 2015 15:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146100#M40780</guid>
      <dc:creator>jswarren</dc:creator>
      <dc:date>2015-07-29T15:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146101#M40781</link>
      <description>&lt;P&gt;Extract out the function name as a field, and use that in your transaction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "function\s(?&amp;lt;function&amp;gt;[^\s]+)\s" | transaction function startswith="Executing" endswith="(value=0)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should pull the whole shebang as a single transaction.  However, this will omit any lines which do not have a 'function' field.  (which may be context you need)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 17:59:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146101#M40781</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2015-07-29T17:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146102#M40782</link>
      <description>&lt;P&gt;If the logging is single-threaded (meaning you won't have processes interleaved with each other) then you can actually omit the 'startswith' and get what you want.  Or, I do in testing at least.&lt;/P&gt;

&lt;P&gt;If you may have multiple hosts running concurrently, then you want to include that in the transaction: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction host endswith="(value=0)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/514i21A59485ED2F9DC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 18:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146102#M40782</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2015-07-29T18:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146103#M40783</link>
      <description>&lt;P&gt;Ahh...yes...that would work, if there weren't "noise" between functions....I'll update the example to reflect that noise.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 18:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146103#M40783</guid>
      <dc:creator>jswarren</dc:creator>
      <dc:date>2015-07-29T18:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146104#M40784</link>
      <description>&lt;P&gt;Or...I would post the update, if I had enough karma....&lt;/P&gt;

&lt;P&gt;Assume that there are more events before the "Executing..." and after the "Completing" that should be excluded.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 18:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146104#M40784</guid>
      <dc:creator>jswarren</dc:creator>
      <dc:date>2015-07-29T18:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep startswith from evicting a previous transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146105#M40785</link>
      <description>&lt;P&gt;Any way to filter out that noise?  It might be a good idea to shape the initial search to only grab the lines you really care about from these transactions.  &lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2015 14:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-keep-startswith-from-evicting-a-previous-transaction/m-p/146105#M40785</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2015-07-30T14:32:44Z</dc:date>
    </item>
  </channel>
</rss>

