<?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: transaction commmand with huge event base in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/transaction-commmand-with-huge-event-base/m-p/52052#M12638</link>
    <description>&lt;P&gt;I don't know about your extraction problem, but I might use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex "sometext" OR ("sometext2" AND val&amp;gt;500) 
| rex "sometext: (?&amp;lt;msg&amp;gt;.*)"
| stats val,msg by field1,field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will run a lot faster if you have the data over multiple indexers, since &lt;CODE&gt;stats&lt;/CODE&gt; will map-reduce much better than &lt;CODE&gt;transaction&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You could do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex ("sometext" OR ("sometext2" AND val&amp;gt;500))
[ search index=myindex "sometext2" AND val&amp;gt;500 
  | fields + field1 field2 
  | format maxresults=10000 ] )
| rex "sometext: (?&amp;lt;msg&amp;gt;.*)"
| stats val,msg by field1,field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but whether that is actually faster depends on your data.   &lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2011 03:34:44 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2011-03-02T03:34:44Z</dc:date>
    <item>
      <title>transaction commmand with huge event base</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-commmand-with-huge-event-base/m-p/52051#M12637</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've the following _raw event base:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;line1 field1=field1Value field2=field2Value sometext: a_string&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;line2 field1=field1Value field2=field2Value sometext2 val=400&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;line3 field1=field1Value field2=field2Value sometext2 val=600&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;... and like to have the table that only contains events where val reaches a limit. When this limit is reached, I like to see the value behind "sometext: " (=a_string) from the event above with same field1Value and field2Value.&lt;/P&gt;

&lt;P&gt;The resulting table should have the cols:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;field1 | field2 | val | msg&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;A row should have the values:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;field1Value | field1Value | 600 | a_string&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Here's my try with the transaction command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex "sometext" OR ("sometext2" AND val&amp;gt;500) 
| transaction field1 field2 
| rex field=_raw "sometext: (?&amp;lt;msg&amp;gt;.*)" 
| table field1 field2 val msg
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The 2 issues are:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;the msg field is always emtpy and seem to not extracted correctly&lt;/LI&gt;
&lt;LI&gt;The first part of the query (up to the first pipe symbol) is returning a huge number of events (~200k) and thus the transaction seem takes an unacceptable time.
Is the transaction a good way to accomplish such a resulting table? I suppose a "join" is not an option?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 03:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-commmand-with-huge-event-base/m-p/52051#M12637</guid>
      <dc:creator>lwalhoefer</dc:creator>
      <dc:date>2011-03-02T03:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: transaction commmand with huge event base</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-commmand-with-huge-event-base/m-p/52052#M12638</link>
      <description>&lt;P&gt;I don't know about your extraction problem, but I might use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex "sometext" OR ("sometext2" AND val&amp;gt;500) 
| rex "sometext: (?&amp;lt;msg&amp;gt;.*)"
| stats val,msg by field1,field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will run a lot faster if you have the data over multiple indexers, since &lt;CODE&gt;stats&lt;/CODE&gt; will map-reduce much better than &lt;CODE&gt;transaction&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You could do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex ("sometext" OR ("sometext2" AND val&amp;gt;500))
[ search index=myindex "sometext2" AND val&amp;gt;500 
  | fields + field1 field2 
  | format maxresults=10000 ] )
| rex "sometext: (?&amp;lt;msg&amp;gt;.*)"
| stats val,msg by field1,field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but whether that is actually faster depends on your data.   &lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 03:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-commmand-with-huge-event-base/m-p/52052#M12638</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-03-02T03:34:44Z</dc:date>
    </item>
  </channel>
</rss>

