<?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 Why is the below query not working? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377969#M169019</link>
    <description>&lt;P&gt;I have to list the Job_Name orderid Start_Time End_Time. i am using the below query but not getting the values for End_Time. can someone help me with this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="auto_prod_ctm"  sourcetype=daily_ctmag_sa_batch_log "STARTED" earliest=-30m |rex field=_raw "JOB (?.*) \(O"
| rex field=_raw "ORDERID (?[^,]+)"| eval Start_Time=strftime(_time,"%d/%m/%Y %I:%M:%S")|append [search index="auto_prod_ctm" sourcetype=daily_ctmag_sa_batch_log "ENDED OK" earliest=-30m |rex field=_raw "JOB (?.*) \(O" | rex field=_raw "ORDERID (?[^,]+)"|eval End_Time=strftime(_time,"%d/%m/%Y %I:%M:%S")] | table Job_Name orderid Start_Time End_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:56:58 GMT</pubDate>
    <dc:creator>abhi04</dc:creator>
    <dc:date>2020-09-29T19:56:58Z</dc:date>
    <item>
      <title>Why is the below query not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377969#M169019</link>
      <description>&lt;P&gt;I have to list the Job_Name orderid Start_Time End_Time. i am using the below query but not getting the values for End_Time. can someone help me with this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="auto_prod_ctm"  sourcetype=daily_ctmag_sa_batch_log "STARTED" earliest=-30m |rex field=_raw "JOB (?.*) \(O"
| rex field=_raw "ORDERID (?[^,]+)"| eval Start_Time=strftime(_time,"%d/%m/%Y %I:%M:%S")|append [search index="auto_prod_ctm" sourcetype=daily_ctmag_sa_batch_log "ENDED OK" earliest=-30m |rex field=_raw "JOB (?.*) \(O" | rex field=_raw "ORDERID (?[^,]+)"|eval End_Time=strftime(_time,"%d/%m/%Y %I:%M:%S")] | table Job_Name orderid Start_Time End_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377969#M169019</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2020-09-29T19:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the below query not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377970#M169020</link>
      <description>&lt;P&gt;Start_Time and End_Time come from separate events. Just peforming a table command doesn't merge taht into a single line with both Start_Time and End_Time populated.&lt;/P&gt;

&lt;P&gt;Try replacing the &lt;CODE&gt;| table Job_Name orderid Start_Time End_Time&lt;/CODE&gt; with &lt;CODE&gt;| stats values(Start_Time) as Start_Time values(End_Time) as End_Time by Job_Name,orderid&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;If that doesn't solve it:&lt;BR /&gt;
1. Please edit your question and put the search code in as code (using the 101010 button), otherwise it is hard to read and also some special characters will disappear&lt;BR /&gt;
2. Please share sample events&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377970#M169020</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-09-29T19:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the below query not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377971#M169021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;you could join the two searches using the Job_Name and/or orderid information.&lt;BR /&gt;
Please check:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Join"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Join&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 14:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377971#M169021</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2018-06-08T14:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the below query not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377972#M169022</link>
      <description>&lt;P&gt;In such a case, it is good to use the transaction command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="auto_prod_ctm"  sourcetype=daily_ctmag_sa_batch_log  earliest=-30m 
|rex field=_raw "JOB (?.*) \(O" | rex field=_raw "ORDERID (?[^,]+)"
| transaction Job_Name orderid startswith="STARTED" endswith="ENDED OK"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-below-query-not-working/m-p/377972#M169022</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-06-08T15:08:04Z</dc:date>
    </item>
  </channel>
</rss>

