<?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: Building transactions with randomly ordered events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105273#M27296</link>
    <description>&lt;P&gt;Then in that case, you'll have to have something to tie them all together, such as a field4 that has a unique identifier to tie them together.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2013 12:07:31 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2013-07-24T12:07:31Z</dc:date>
    <item>
      <title>Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105270#M27293</link>
      <description>&lt;P&gt;I have a log file with repeating patterns looking like this. Notice there are only 3 distinct field names and pay attention to the 4th, 5th and 6th lines:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
Time1 field1: value1&lt;BR /&gt;
Time2 field2: value2&lt;BR /&gt;
Time3 field3: value3&lt;BR /&gt;
Time4 field2: value4&lt;BR /&gt;
Time5 field1: value5&lt;BR /&gt;
Time6 field3: value6&lt;BR /&gt;
Time7 field1: value7&lt;BR /&gt;
Time8 field2: value8&lt;BR /&gt;
Time9 field3: value9&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;So I have 1 interesting information per line and I would like to group these events together into a single event (probably requires usage of transactions). The result should look like this (pay attention to the 2nd line):&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
Time1 =&amp;gt; Time3 - field1: value1, field2: value2, field3: value3&lt;BR /&gt;
Time4 =&amp;gt; Time6 - field1: value5, field2: value4, field3: value6&lt;BR /&gt;
Time7 =&amp;gt; Time9 - field1: value7, field2: value8, field3: value9&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Unfortunately, as you can see, the order in which these fields are coming is more or less random. I can only rely on these rules, binding the lines together:&lt;BR /&gt;
 * "field3" always closes a transaction&lt;BR /&gt;
 * "field1" and "field2" have relatively close timestamps (5 minutes at most between them)&lt;/P&gt;

&lt;P&gt;I've tried many combinations of "transaction", "filldown" and "sort" functions, but I'm unable to get the expected result.&lt;/P&gt;

&lt;P&gt;Could somebody help me ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 09:15:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105270#M27293</guid>
      <dc:creator>yoho</dc:creator>
      <dc:date>2013-07-24T09:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105271#M27294</link>
      <description>&lt;P&gt;If the log is written within a certain time frame consistently, you can try:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search | transaction maxspan=4m endswith="field3" maxevents=3 | stats...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The maxspan indicates that 4m is the time "bucket" within which all the events of the transaction fall. endswith tells transaction what the final event should be. maxevents is, well, the max number events that can be in the transaction.&lt;/P&gt;

&lt;P&gt;Is it possible to have the log output a unique id for each transaction? That would simplify your efforts a great deal.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Transaction" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Transaction&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 10:56:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105271#M27294</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-24T10:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105272#M27295</link>
      <description>&lt;P&gt;That's interesting but doesn't exactly solve the problem. &lt;/P&gt;

&lt;P&gt;Let's take the first transaction: although Time1 and Time2 are relatively close (4m for maxspan would be ok), Time3 can be several hours later and the "maxspan" condition isn't met for the whole transaction.&lt;/P&gt;

&lt;P&gt;I believe "transaction" can't be used to group the first 2 lines of the transaction because there is no pre-defined order but maybe another function would be ok.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 11:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105272#M27295</guid>
      <dc:creator>yoho</dc:creator>
      <dc:date>2013-07-24T11:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105273#M27296</link>
      <description>&lt;P&gt;Then in that case, you'll have to have something to tie them all together, such as a field4 that has a unique identifier to tie them together.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 12:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105273#M27296</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-24T12:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105274#M27297</link>
      <description>&lt;P&gt;I found an ankward solution.&lt;/P&gt;

&lt;P&gt;I must first note that "filldown" function fills in the values "down the page" which is actually in the reverse order of time (as most recent events come first).&lt;/P&gt;

&lt;P&gt;So the trick is first to reverse the order of events with "|sort _time". Then you need to add "|filldown field1, field2", so that you can propagate values of these fields to all events in the future. In the end, lines with "field3" will contain field1, field2 and field3 values and you just have to filter on these events with "|search field3".&lt;/P&gt;

&lt;P&gt;It doesn't entirely answers to the question as you will loose the first timestamp of the transaction (Time1, Time4 and Time7) but I didn't actually really need it.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 15:28:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105274#M27297</guid>
      <dc:creator>yoho</dc:creator>
      <dc:date>2013-07-24T15:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105275#M27298</link>
      <description>&lt;P&gt;Better than "|sort _time", "|reverse" is probably faster&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2013 11:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105275#M27298</guid>
      <dc:creator>yoho</dc:creator>
      <dc:date>2013-08-06T11:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Building transactions with randomly ordered events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105276#M27299</link>
      <description>&lt;P&gt;Hi yoho, see if this article helps you shed some light:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://foren6.wordpress.com/2014/11/18/why-is-my-splunk-transaction-not-working/"&gt;http://foren6.wordpress.com/2014/11/18/why-is-my-splunk-transaction-not-working/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2014 19:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Building-transactions-with-randomly-ordered-events/m-p/105276#M27299</guid>
      <dc:creator>inode</dc:creator>
      <dc:date>2014-11-18T19:23:24Z</dc:date>
    </item>
  </channel>
</rss>

