<?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: Nested search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346126#M164337</link>
    <description>&lt;P&gt;Does the output of this look like what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=*dbcase* 
    [ search source=*dbcase* DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT 
    | table clientSessionId] 
| rename Properties.args{} as properties 
| rex "accountId.....(?&amp;lt;accountid&amp;gt;\w+)"
| eval url=if('Properties.index'="0", properties, NULL)
| stats list(accountid) AS accountid, list(url) AS url BY clientSessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Dec 2017 01:14:11 GMT</pubDate>
    <dc:creator>micahkemp</dc:creator>
    <dc:date>2017-12-15T01:14:11Z</dc:date>
    <item>
      <title>Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346120#M164331</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have 3 queries that I need to combine.&lt;/P&gt;

&lt;P&gt;The first one gives a list of clientSessionId's&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT|table clientSessionId 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The next one would use the list from the first query to display a list of account Ids  (I've already combined the first query with the second query)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app CustomAnalytic Properties.index=1 [search index=wholesale_app DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT|table clientSessionId]|rename Properties.args{} as properties  |rex  "accountId.....(?&amp;lt;accountid&amp;gt;\w+)"|stats count by accountid|where len(accountid)&amp;lt;10 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the part that I don't know how to do...  On the third query I need to extract the URL.  The basic query is this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice Properties.index=0|rename Properties.args{} as properties |stats count by properties
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The common linking field across all the queries is clientSessionId.   I can get two queries to work but not sure how to get the third one merged in.  I thought it would be something like this but it barfs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice Properties.index=0 [search index=wholesale_app CustomAnalytic Properties.index=1 |rex  "accountId.....(?&amp;lt;accountid&amp;gt;\w+)"|where len(accountid)&amp;lt;10|stats count by accountid [search index=wholesale_app DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT|stats count by clientSessionId]]|rename Properties.args{} as properties |stats count by accountid properties 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any thoughts???&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 23:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346120#M164331</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-14T23:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346121#M164332</link>
      <description>&lt;P&gt;Edited to show the search that led to your final search:&lt;/P&gt;

&lt;P&gt;Edited again cause, oops, I forgot to change my base search back to your base search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=wholesale_app 
     [ search index=wholesale_app DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT 
     | table clientSessionId] 
 | rename Properties.args{} as properties 
 | rex "accountId.....(?&amp;lt;accountid&amp;gt;\w+)"
 | eval url=if('Properties.index'="0", properties, NULL)
 | stats list(accountid) AS accountid, list(url) AS url BY clientSessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Dec 2017 00:08:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346121#M164332</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-15T00:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346122#M164333</link>
      <description>&lt;P&gt;Hi Michakemp,&lt;/P&gt;

&lt;P&gt;Apologies, I should have included data examples.  I tried your query with high hopes but no joy...  Not sure how you even got that far without data examples.  Impressive!&lt;/P&gt;

&lt;P&gt;On to the data examples&lt;/P&gt;

&lt;P&gt;Here is an event for the first query (unsupported_format)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         UNSUPPORTED_FORMAT 
        ]   
         category:   Event  
         index:  3  
    }   
     analyticType:   DynamicChoice  
     buildTarget:    blah   
     clientSessionId:    DXJNRLI-AIUGREA    
     product:    blah   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is one from the second query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         {"accountId":"exr413508","customerId":"1002330"}   
        ]   
         category:   Event  
         index:  1  
    }   
     analyticType:   CustomAnalytic 
     buildTarget:    blah   
     clientSessionId:    DXJNRLI-AIUGREA    
     product:    blah   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And finally the third query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         &lt;A href="https://beta.something.com" target="test_blank"&gt;https://beta.something.com&lt;/A&gt; 
        ]   
         category:   Event  
         index:  0  
    }   
     analyticType:   DynamicChoice  
     buildTarget:    blah   
     clientSessionId:    DXJNRLI-AIUGREA    
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope that helps because I'm stumped&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 00:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346122#M164333</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-15T00:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346123#M164334</link>
      <description>&lt;P&gt;I was thinking something like appendcols might help but I've really not used that one before.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 00:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346123#M164334</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-15T00:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346124#M164335</link>
      <description>&lt;P&gt;Can you paste the raw text instead of the syntax highlighted version?  Click the 'show as raw text' link for your search result.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 01:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346124#M164335</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-15T01:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346125#M164336</link>
      <description>&lt;P&gt;sure!&lt;/P&gt;

&lt;P&gt;first one&lt;BR /&gt;
    {"analyticType":"DynamicChoice","buildTarget":"blah","product":"blah","clientSessionId":"DXJNRLI-AIUGREA","Properties":{"index":3,"args":["UNSUPPORTED_FORMAT"],"category":"Event"}}&lt;/P&gt;

&lt;P&gt;second one&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"analyticType":"CustomAnalytic","buildTarget":"blah","product":"blah","clientSessionId":"DXJNRLI-AIUGREA","Properties":{"index":1,"args":["{\"accountId\":\"exr413508\",\"customerId\":\"1002330\"}"],"category":"Event"}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;third one&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"analyticType":"DynamicChoice","buildTarget":"blah","clientSessionId":"DXJNRLI-AIUGREA","Properties":{"index":0,"args":["https://beta.something.com"],"category":"Event"}}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Dec 2017 01:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346125#M164336</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-15T01:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346126#M164337</link>
      <description>&lt;P&gt;Does the output of this look like what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=*dbcase* 
    [ search source=*dbcase* DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT 
    | table clientSessionId] 
| rename Properties.args{} as properties 
| rex "accountId.....(?&amp;lt;accountid&amp;gt;\w+)"
| eval url=if('Properties.index'="0", properties, NULL)
| stats list(accountid) AS accountid, list(url) AS url BY clientSessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Dec 2017 01:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346126#M164337</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-15T01:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Nested search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346127#M164338</link>
      <description>&lt;P&gt;whooo hoooo!&lt;/P&gt;

&lt;P&gt;Yours was very very close!  I made a couple of modifications and presto!&lt;/P&gt;

&lt;P&gt;Here is what I ended up with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app [ search index=wholesale_app DynamicChoice Properties.index=3 buildTarget=* product=* UNSUPPORTED_FORMAT 
     | table clientSessionId] 
 | rename Properties.args{} as properties 
 | rex "accountId.....(?&amp;lt;accountid&amp;gt;\w+)"
 | eval url=if('Properties.index'="0" AND 'analyticType'="DynamicChoice", properties, NULL)
 | stats list(accountid) AS accountid, values(url) AS url BY clientSessionId |where len(accountid)&amp;lt;10 |where len(url)&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;THank you sooooooooo much!!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 01:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-search/m-p/346127#M164338</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-15T01:30:02Z</dc:date>
    </item>
  </channel>
</rss>

