<?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 Search Advanced Nested query many line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219701#M64562</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have lot of line with expression like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;code=1 executionTime=n ident=XXX
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and lot of line with expression like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;code=2 executionTime=m otherIdent=XXX ident=YYYY
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like substract the executionTime of line with code 1 with line in code 2.&lt;BR /&gt;
I try with this query but it doesn't work :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index code=1 [search index=my_index code=2 | RENAME executionTime as retrieveExecutionTime| RENAME code as retrieveCode| RENAME ident AS retrieveIdent |RENAME otherIdent as ident| FIELDS ident] | TABLE ident,code, executionTime, retrieveExecutionTime, retrieveCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Columns retrieveExecutionTime, retrieveCode are empty.&lt;BR /&gt;
How can I have one line by ident/otherIdent with all necessary information ?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2016 13:16:46 GMT</pubDate>
    <dc:creator>mclane1</dc:creator>
    <dc:date>2016-10-03T13:16:46Z</dc:date>
    <item>
      <title>Search Advanced Nested query many line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219701#M64562</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have lot of line with expression like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;code=1 executionTime=n ident=XXX
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and lot of line with expression like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;code=2 executionTime=m otherIdent=XXX ident=YYYY
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like substract the executionTime of line with code 1 with line in code 2.&lt;BR /&gt;
I try with this query but it doesn't work :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index code=1 [search index=my_index code=2 | RENAME executionTime as retrieveExecutionTime| RENAME code as retrieveCode| RENAME ident AS retrieveIdent |RENAME otherIdent as ident| FIELDS ident] | TABLE ident,code, executionTime, retrieveExecutionTime, retrieveCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Columns retrieveExecutionTime, retrieveCode are empty.&lt;BR /&gt;
How can I have one line by ident/otherIdent with all necessary information ?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 13:16:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219701#M64562</guid>
      <dc:creator>mclane1</dc:creator>
      <dc:date>2016-10-03T13:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Search Advanced Nested query many line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219702#M64563</link>
      <description>&lt;P&gt;Please try append command - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=my_index code=1 
|append [search index=my_index code=2 | RENAME executionTime as retrieveExecutionTime| RENAME code as retrieveCode| RENAME ident AS retrieveIdent |RENAME otherIdent as ident| FIELDS ident] 
| TABLE ident,code, executionTime, retrieveExecutionTime, retrieveCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 16:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219702#M64563</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-03T16:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Search Advanced Nested query many line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219703#M64564</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index  code=1 OR code=2 | streamstats count by code | streamstats window=1 current=f values(executionTime) as retrieveExecutionTime by count | table _time code count executionTime retrieveExecutionTime 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 16:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219703#M64564</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-03T16:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search Advanced Nested query many line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219704#M64565</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex (code=1 OR code=2) 
| fields ident otherIdent code executionTime
| eval ident=if(code=1,ident,otherIdent)
| eval retrieveIdent=if(code=2,ident,null())
| eval retrieveCode=if(code=2,code,null())
| eval retrieveExecutionTime=if(code=2,executionTime,null())
| stats values(*) as * by ident
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 17:11:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219704#M64565</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-03T17:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Search Advanced Nested query many line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219705#M64566</link>
      <description>&lt;P&gt;Thanks for answer.&lt;BR /&gt;
Unfortunatly, it's always empty for retrieve... columns.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 06:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219705#M64566</guid>
      <dc:creator>mclane1</dc:creator>
      <dc:date>2016-10-04T06:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Search Advanced Nested query many line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219706#M64567</link>
      <description>&lt;P&gt;Hello;&lt;BR /&gt;
I understand idea.&lt;BR /&gt;
I have table like this :&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;||code||ident||otherIdent||executionTime||&lt;BR /&gt;
|1|i1|oi1|t1|&lt;BR /&gt;
|2|X|i1|t2|&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and I can transform this table like this (with eval)&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;||code||ident||otherIdent||executionTime||id||executionTime1||executionTime2||...||&lt;BR /&gt;
|1|i1|oi1|t1|i1|t1|null|...|&lt;BR /&gt;
|2|X|i1|t2|i1|null|t2|...|&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;with stats values do only one line.&lt;/P&gt;

&lt;P&gt;Very good idea. &lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 06:35:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Advanced-Nested-query-many-line/m-p/219706#M64567</guid>
      <dc:creator>mclane1</dc:creator>
      <dc:date>2016-10-04T06:35:35Z</dc:date>
    </item>
  </channel>
</rss>

