<?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: Using subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25115#M177544</link>
    <description>&lt;P&gt;That's execellent. Thank you very much!&lt;/P&gt;</description>
    <pubDate>Wed, 07 Nov 2012 20:18:06 GMT</pubDate>
    <dc:creator>shangshin</dc:creator>
    <dc:date>2012-11-07T20:18:06Z</dc:date>
    <item>
      <title>Using subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25111#M177540</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
   I have a log file with 3 columns, timestamp, processID and state. When the process starts or ends, a row is inserted into the log file. What's the best search string to find out all jobs in start state?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time PID   State 
9:22 1000  start
9:23 2000  start
9:24 3000  start
9:25 4000  start
9:26 5000  start
9:37 2000  end
9:38 4000  end
9:39 6000  start
9:40 7000  start
9:41 5000  end
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2012 15:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25111#M177540</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2012-11-06T15:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25112#M177541</link>
      <description>&lt;P&gt;I don't think a subsearch would be of any use in your scenario. Rather I'd advise you to use &lt;CODE&gt;transaction&lt;/CODE&gt; or &lt;CODE&gt;stats&lt;/CODE&gt;. Both can be used to group events by PID and then show you the groups that have a start event but no end event.&lt;/P&gt;

&lt;P&gt;Using &lt;CODE&gt;stats&lt;/CODE&gt;, it would be something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count,values(State) by PID | where count&amp;lt;2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And similarly, using &lt;CODE&gt;transaction&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction PID | search eventcount&amp;lt;2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2012 16:32:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25112#M177541</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-06T16:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25113#M177542</link>
      <description>&lt;P&gt;I like the solution using transaction. Is there a way to find out the total traction time?&lt;BR /&gt;
E.g. the PID 2000 took 14 minutes using the above sample log.&lt;/P&gt;

&lt;P&gt;This will be very useful.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2012 20:26:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25113#M177542</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2012-11-06T20:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25114#M177543</link>
      <description>&lt;P&gt;Sure - the &lt;CODE&gt;transaction&lt;/CODE&gt; command always produces two fields, &lt;CODE&gt;eventcount&lt;/CODE&gt; and &lt;CODE&gt;duration&lt;/CODE&gt;. We already used &lt;CODE&gt;eventcount&lt;/CODE&gt; for the answer to your first question, and you could use &lt;CODE&gt;duration&lt;/CODE&gt; for your second - it simply holds the duration, in seconds, of each transaction.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2012 21:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25114#M177543</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-06T21:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25115#M177544</link>
      <description>&lt;P&gt;That's execellent. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 20:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-subsearch/m-p/25115#M177544</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2012-11-07T20:18:06Z</dc:date>
    </item>
  </channel>
</rss>

