<?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 Splunk Grouping not works always in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332171#M159753</link>
    <description>&lt;P&gt;I am using the following splunk query &lt;/P&gt;

&lt;P&gt;to combine the events in to one transaction based on the referenceid.&lt;BR /&gt;
It works fine for most of the transactions ... but some transactions are grouped  not based on matching referenceid&lt;BR /&gt;
Kindly let me know what i am missing here..&lt;BR /&gt;
Thanks in advance&lt;/P&gt;

&lt;P&gt;index="xxxx" host="yyyy.local" referenceid | transaction startswith="SplunkLoggingStart" endswith="SplunkLoggingEnd" | convert ctime(_time) as TransactionTime&lt;/P&gt;

&lt;P&gt;26 Jul 2017 11:16:00,833 [WARN ] {Route Executor 0} (Route.50.Filter.39) SplunkLoggingStart ReferenceId: f680f964-7057-3b9b-a5d6-f07767238e91 &lt;/P&gt;

&lt;P&gt;26 Jul 2017 11:16:00,955 [WARN ] {Route Executor 7} (Route.50.Filter.39) Step 1 InputRequest ReferenceId: f680f964-7057-3b9b-a5d6-f07767238e91 &lt;/P&gt;

&lt;P&gt;6 Jul 2017 11:15:58,127 [WARN ] {Route Executor 7} (Route.50.Filter.46) Step 4 OutputResponse ReferenceId:  f680f964-7057-3b9b-a5d6-f07767238e91&lt;/P&gt;

&lt;P&gt;26 Jul 2017 11:16:03,086 [WARN ] {Route Executor 3} (Route.50.Filter.46) SplunkLoggingEnd ReferenceId: f680f964-7057-3b9b-a5d6-f07767238e91 &lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2017 21:50:17 GMT</pubDate>
    <dc:creator>nkannan1984</dc:creator>
    <dc:date>2017-07-27T21:50:17Z</dc:date>
    <item>
      <title>Splunk Grouping not works always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332171#M159753</link>
      <description>&lt;P&gt;I am using the following splunk query &lt;/P&gt;

&lt;P&gt;to combine the events in to one transaction based on the referenceid.&lt;BR /&gt;
It works fine for most of the transactions ... but some transactions are grouped  not based on matching referenceid&lt;BR /&gt;
Kindly let me know what i am missing here..&lt;BR /&gt;
Thanks in advance&lt;/P&gt;

&lt;P&gt;index="xxxx" host="yyyy.local" referenceid | transaction startswith="SplunkLoggingStart" endswith="SplunkLoggingEnd" | convert ctime(_time) as TransactionTime&lt;/P&gt;

&lt;P&gt;26 Jul 2017 11:16:00,833 [WARN ] {Route Executor 0} (Route.50.Filter.39) SplunkLoggingStart ReferenceId: f680f964-7057-3b9b-a5d6-f07767238e91 &lt;/P&gt;

&lt;P&gt;26 Jul 2017 11:16:00,955 [WARN ] {Route Executor 7} (Route.50.Filter.39) Step 1 InputRequest ReferenceId: f680f964-7057-3b9b-a5d6-f07767238e91 &lt;/P&gt;

&lt;P&gt;6 Jul 2017 11:15:58,127 [WARN ] {Route Executor 7} (Route.50.Filter.46) Step 4 OutputResponse ReferenceId:  f680f964-7057-3b9b-a5d6-f07767238e91&lt;/P&gt;

&lt;P&gt;26 Jul 2017 11:16:03,086 [WARN ] {Route Executor 3} (Route.50.Filter.46) SplunkLoggingEnd ReferenceId: f680f964-7057-3b9b-a5d6-f07767238e91 &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 21:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332171#M159753</guid>
      <dc:creator>nkannan1984</dc:creator>
      <dc:date>2017-07-27T21:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Grouping not works always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332172#M159754</link>
      <description>&lt;P&gt;If your ReferenceId numbers are unique, then you don't have to use &lt;CODE&gt;startswith&lt;/CODE&gt; and &lt;CODE&gt;endswith&lt;/CODE&gt;. You can just use the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="xxxx" host="yyyy.local" referenceid |rex "ReferenceId:\s+(?&amp;lt;referenceid&amp;gt;.*)" | transaction referenceid | table duration, referenceid, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will give you the time of the transaction and the duration. You are including all events that have "referenceid" which is the string it is looking for, so you get all of them that have &lt;CODE&gt;ReferenceId&lt;/CODE&gt;, too, but you probably aren't getting them field extracted (which I do in the &lt;CODE&gt;rex&lt;/CODE&gt; in my search), then you tell it to group the events together by the &lt;CODE&gt;referenceid&lt;/CODE&gt; that was extracted. The &lt;CODE&gt;_time&lt;/CODE&gt; and, if you need it, the &lt;CODE&gt;duration&lt;/CODE&gt; of the transaction. Transaction wants to know what to group together, not just the &lt;CODE&gt;startswith&lt;/CODE&gt; and &lt;CODE&gt;endswith&lt;/CODE&gt;, so you tell it the &lt;CODE&gt;referenceid&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 23:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332172#M159754</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-07-27T23:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Grouping not works always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332173#M159755</link>
      <description>&lt;P&gt;If this worked for you, please accept the answer so that others finding this question will know what will work for them.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 22:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332173#M159755</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-08-01T22:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Grouping not works always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332174#M159756</link>
      <description>&lt;P&gt;Thanks this was very helpful .I ended up with something like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="xxxx" host="yyyy.local" referenceid | rex field=_raw "(?&amp;lt;ReferenceID&amp;gt;\b[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}\b)" | transaction ReferenceID 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 22:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Grouping-not-works-always/m-p/332174#M159756</guid>
      <dc:creator>nkannan1984</dc:creator>
      <dc:date>2017-08-01T22:36:49Z</dc:date>
    </item>
  </channel>
</rss>

