<?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 fetch the before event of the search field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269163#M189984</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;am able to see the querySeconds field in search fields, when I try to put the dashboard it is giving me no results found.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2016 16:07:33 GMT</pubDate>
    <dc:creator>Abilan1</dc:creator>
    <dc:date>2016-03-30T16:07:33Z</dc:date>
    <item>
      <title>How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269155#M189976</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;I am looking for two different search on the single log file and am using below command to search.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=Test host=XXX "ABNUM" |  map search="search source=$source$ "took""&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;I wanted to take the seconds which is highlighted on the below field only for the table ABNUM (which is on next event). The problem with the above search I've multiple table which is also having this second deatils. So It is giving me the output of that one as well. I would like to restrict this search only to the before event not on the entire source file.&lt;/P&gt;

&lt;P&gt;Log File:&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:07:28.654666  doQueryDiagnostics: The following SQL query took &lt;STRONG&gt;4 seconds&lt;/STRONG&gt; which is equal to or greater than QueryExecutionTimeThreshold (4 seconds)&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:07:28.654975  SELECT * FROM ABNUM  WHERE  ( RPAN8 = 68537110.000000 ) &lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 03:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269155#M189976</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-03-29T03:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269156#M189977</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Test host=XXX "ABNUM" | map search="search source=$source$ | streamstats current=f last(_raw) AS next_line | search \" took \""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should show all of your &lt;CODE&gt;took&lt;/CODE&gt; events and each one should contain a field &lt;CODE&gt;next_line&lt;/CODE&gt; that is the &lt;CODE&gt;ABNUM&lt;/CODE&gt; event.  From there, you can tack on something like &lt;CODE&gt;| rex field=next_line blah&lt;/CODE&gt; to pull the SQL or whatever out.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 07:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269156#M189977</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-29T07:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269157#M189978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks, I've one more problem here, actually there are other tables also in the log like EmpID, etc..so the above query is fetching the "took" from those entries as well..sample below.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Log:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:07:28.654666 doQueryDiagnostics: The following SQL query took 4 seconds which is equal to or greater than QueryExecutionTimeThreshold (4 seconds)&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:07:28.654975 SELECT * FROM ABNUM WHERE ( RPAN8 = 68537110.000000 )&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:17:08.654666 doQueryDiagnostics: The following SQL query took 15 seconds which is equal to or greater than QueryExecutionTimeThreshold (4 seconds)&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:17:08.654975 SELECT * FROM EMPID Where ABC=1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 08:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269157#M189978</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-03-29T08:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269158#M189979</link>
      <description>&lt;P&gt;OK, then use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Test host=XXX "ABNUM" | map search="search source=$source$ | streamstats current=f last(_raw) AS next_line | search \" took \" next_line=\"*ABNUM*\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2016 08:30:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269158#M189979</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-29T08:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269159#M189980</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;am not able to see your answers, can you please post it again..Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 15:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269159#M189980</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-03-30T15:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269160#M189981</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=Test host=XXX "ABNUM" | map search="search source=$source$ | streamstats current=f last(_raw) AS next_line | search \" took \" next_line=\"*ABNUM*\"" | dedup _raw next_line | rex "query took (?&amp;lt;querySeconds&amp;gt;\d+).*\((?&amp;lt;QueryExecutionTimeThreshold&amp;gt;\d+) seconds\)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Mar 2016 15:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269160#M189981</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-30T15:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269161#M189982</link>
      <description>&lt;P&gt;Thank you.. I've to use "query seconds" in my dashboard right? and is there any threshold value we have here?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 15:47:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269161#M189982</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-03-30T15:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269162#M189983</link>
      <description>&lt;P&gt;I assume so but it is &lt;EM&gt;your&lt;/EM&gt; data!  I can only tell you how to manipulate it and access it; only you know what it &lt;EM&gt;means&lt;/EM&gt;.  The threshold, which appears to be a constant (4), is in the field named &lt;CODE&gt;QueryExecutionTimeThreshold&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 15:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269162#M189983</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-30T15:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269163#M189984</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;am able to see the querySeconds field in search fields, when I try to put the dashboard it is giving me no results found.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 16:07:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269163#M189984</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-03-30T16:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269164#M189985</link>
      <description>&lt;P&gt;This is an entirely different question.  Click "Accept" to close this Q&amp;amp;A and ask a new question.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 16:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269164#M189985</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-30T16:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the before event of the search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269165#M189986</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 18:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-before-event-of-the-search-field/m-p/269165#M189986</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-03-30T18:46:42Z</dc:date>
    </item>
  </channel>
</rss>

