<?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 filter events from a transaction result. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282980#M85488</link>
    <description>&lt;P&gt;First, get rid of &lt;CODE&gt;transaction&lt;/CODE&gt; by manufacturing a &lt;CODE&gt;sessoinID&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | reverse | streamstats current=t count(eval(searchmatch("start"))) AS sessionID | stats list(_raw) by sessionID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now that you have a &lt;CODE&gt;sessionID&lt;/CODE&gt; field for every event, you have more control and can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | reverse | streamstats current=t count(eval(searchmatch("Start"))) AS sessionID | streamstats current=t count(eval(searchmatch("DEBUG - PQR" OR "DEBUG - XYZ"))) AS subsessionID by sessionID | search subsessionID="1" NOT Start | stats list(_raw) by sessionID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Oct 2015 17:51:11 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-10-19T17:51:11Z</dc:date>
    <item>
      <title>How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282970#M85478</link>
      <description>&lt;P&gt;After the transaction command, I got a set of events as one event. Now I want to filter the logs from this transaction result.&lt;/P&gt;

&lt;P&gt;Let's say my transaction result has 10 lines as Line 1 to Line 10.&lt;BR /&gt;
Now I want only lines from line 3 to line 8.&lt;BR /&gt;
How can I do this??&lt;BR /&gt;
Please help... Asap..&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 11:11:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282970#M85478</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2015-10-19T11:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282971#M85479</link>
      <description>&lt;P&gt;An example please?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 11:29:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282971#M85479</guid>
      <dc:creator>jmallorquin</dc:creator>
      <dc:date>2015-10-19T11:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282972#M85480</link>
      <description>&lt;P&gt;Query: &lt;BR /&gt;
search...|transaction startswith:"start" endswith:"end"&lt;/P&gt;

&lt;P&gt;And i got the event as below,&lt;/P&gt;

&lt;P&gt;2015/10/17 06:32:43,872 EDT - DEBUG - Start&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - PQR&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - ABC&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - ABC&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - ABC&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - ABC&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - XYZ&lt;BR /&gt;
2015/10/17 06:32:43,872 EDT - DEBUG - End&lt;/P&gt;

&lt;P&gt;now i need the only logs from DEBUG - PQR      to     DEBUG - XYZ&lt;/P&gt;

&lt;P&gt;Please help...&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 11:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282972#M85480</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2015-10-19T11:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282973#M85481</link>
      <description>&lt;P&gt;The filter (from row 3 to row &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; is fixed OR it's depend on the some value in the actual data?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282973#M85481</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-19T14:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282974#M85482</link>
      <description>&lt;P&gt;Its not fixed.. it depends on the keyword i use.. and depends on the requirement...&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:31:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282974#M85482</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2015-10-19T14:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282975#M85483</link>
      <description>&lt;P&gt;Maybe use mvindex? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval NewField=mvindex(_raw, 3, 8)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:37:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282975#M85483</guid>
      <dc:creator>dkoops</dc:creator>
      <dc:date>2015-10-19T14:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282976#M85484</link>
      <description>&lt;P&gt;See if something like this would work for you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | eval RawLines=_raw|transaction startswith:"start" endswith:"end" | eval RawLines=mvfilter(NOT match(RawLines,"Start") AND NOT match(RawLines,"End"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field _raw though seems like an multivalued field in events tab, but its actually not, So I created another field which will hold the raw data lines and filter is applied on that field.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:43:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282976#M85484</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-19T14:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282977#M85485</link>
      <description>&lt;P&gt;Seems like the _raw field isn't a multi value field after a transaction. It does however work for other fields. Maybe extract the useful info from the logs before transactioning? &lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:46:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282977#M85485</guid>
      <dc:creator>dkoops</dc:creator>
      <dc:date>2015-10-19T14:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282978#M85486</link>
      <description>&lt;P&gt;the filtering is not based on line numbers. its based on some keywords, lets say "ReStart" to "Close", need the logs which are in between these keywords..and the line numbers are not fixed too.. &lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282978#M85486</guid>
      <dc:creator>harish_ka</dc:creator>
      <dc:date>2015-10-19T14:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282979#M85487</link>
      <description>&lt;P&gt;You could use regular expression to extract the relevant info from the _raw field. That might, however, be a tedious job if there are a lot of exceptions; you might have to write several ones. This should work for your example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "PQR\s(?&amp;lt;RelevantLogStuff&amp;gt;.+)\s2015.+XYZ"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2015 15:24:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282979#M85487</guid>
      <dc:creator>dkoops</dc:creator>
      <dc:date>2015-10-19T15:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter events from a transaction result.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282980#M85488</link>
      <description>&lt;P&gt;First, get rid of &lt;CODE&gt;transaction&lt;/CODE&gt; by manufacturing a &lt;CODE&gt;sessoinID&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | reverse | streamstats current=t count(eval(searchmatch("start"))) AS sessionID | stats list(_raw) by sessionID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now that you have a &lt;CODE&gt;sessionID&lt;/CODE&gt; field for every event, you have more control and can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | reverse | streamstats current=t count(eval(searchmatch("Start"))) AS sessionID | streamstats current=t count(eval(searchmatch("DEBUG - PQR" OR "DEBUG - XYZ"))) AS subsessionID by sessionID | search subsessionID="1" NOT Start | stats list(_raw) by sessionID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2015 17:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-events-from-a-transaction-result/m-p/282980#M85488</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-19T17:51:11Z</dc:date>
    </item>
  </channel>
</rss>

