<?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 would I use multiple values from a subsearch as input to the main search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323620#M96623</link>
    <description>&lt;P&gt;Actually I have 2 below logger, In that common field is UniqueReqId only.&lt;/P&gt;

&lt;P&gt;LOGGER([UniqueReqId]+[MyLogger])&lt;BR /&gt;
LOGGER([UniqueReqId]+[userName]+[Action])&lt;/P&gt;

&lt;P&gt;So my requirement is i need to find out the UniqueReqId which contains MyLogger.[ This i want to search in sub-search block.]&lt;/P&gt;

&lt;P&gt;once i will get the &lt;BR /&gt;
all possible UniqueReqId in sub-search then We need to find out the userName who is using action=myAction and UniqueReqId=[Multiple UniqueReqId from subsearch].&lt;BR /&gt;
So fetch the userName from all possible UniqueReqId got from subsearch where action=myAction.&lt;/P&gt;

&lt;P&gt;We have multiple actions, so action=MyAction and UniqueReqId=(02191c34-b485,0228ff59,02be90c8,02e2ef7f etc)&lt;/P&gt;

&lt;P&gt;MyLogger is not require here, because it does not apear in other logger.&lt;/P&gt;

&lt;P&gt;Below command is working fine for me. Thanks Giuseppe &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;index=myIndex [ search index=myIndex MyLogger | dedup UniqueReqId | fields UniqueReqId ]&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 11:56:38 GMT</pubDate>
    <dc:creator>mdwasimkhan</dc:creator>
    <dc:date>2017-07-25T11:56:38Z</dc:date>
    <item>
      <title>How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323617#M96620</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am looking for a query which will accept multiple value subsearch output as a input of main serach, See below : &lt;/P&gt;

&lt;P&gt;index=myIndex UniqueReqId in [ &lt;STRONG&gt;&lt;EM&gt;search index=myIndex MyLogger | dedup UniqueReqId | stats count(UniqueReqId) as "Total user" by UniqueReqId&lt;/EM&gt;&lt;/STRONG&gt; ]&lt;/P&gt;

&lt;P&gt;This sub search "&lt;STRONG&gt;&lt;EM&gt;search index=myIndex MyLogger | dedup UniqueReqId | stats count(UniqueReqId) as "Total user" by UniqueReqId&lt;/EM&gt;&lt;/STRONG&gt;" will return multiple value like below : &lt;/P&gt;

&lt;P&gt;UniqueReqId                             Total user&lt;BR /&gt;
002cc2c7-b1e4-49de-bbd3-caa6c2e741e3    1&lt;BR /&gt;
00426627-98cf-4dd5-97b6-af4cde045286    1&lt;BR /&gt;
00567c49-5638-4a0c-a803-04d0b3662aac    1&lt;BR /&gt;
006ef351-33b8-40ed-b320-28473ea1f481    1&lt;BR /&gt;
00caf75c-deed-4581-ab5a-04929b1a943d    1&lt;BR /&gt;
00ff69ef-d57c-43ad-9b64-38cf39b94f6f    1&lt;BR /&gt;
01395957-648b-4e9a-ac76-7fa68f833fce    1&lt;BR /&gt;
01e82329-3d58-4d11-bdca-88100a2dc85c    1&lt;BR /&gt;
02084578-869a-4ce5-bc20-b86c3fea34d2    1&lt;BR /&gt;
021272cb-c043-483f-8512-244210471c63    1&lt;BR /&gt;
02191c34-b485-4a6d-9d77-53f0a8e7875c    1&lt;BR /&gt;
0228ff59-27f8-47e1-a38f-88acdb94fb22    1&lt;BR /&gt;
028177b6-f2f3-4c53-948e-558d51287d43    1&lt;BR /&gt;
02be90c8-5737-4f89-a204-2a3ea5f79047    1&lt;BR /&gt;
02df9ecb-29bf-4aad-b479-26fde9b6ca94    1&lt;BR /&gt;
02e2ef7f-ea55-4311-b724-c06fe5ab416d    1&lt;BR /&gt;
02e7bacd-4579-44c6-b4c2-be0a4fbf4566    1&lt;BR /&gt;
02eb4faa-39c1-431d-9590-a1fabc7eecd8    1&lt;BR /&gt;
031229db-d4ef-4783-b649-9a1e738d495a    1&lt;BR /&gt;
03216368-6d8e-42e9-8fb1-e2ace7794f4c     1&lt;/P&gt;

&lt;P&gt;Now whatever the value we are getting in column UniqueReqId, we need to use each value one by one to the main query in UniqueReqId=&lt;STRONG&gt;&lt;EM&gt;EachValue&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Like Sample example : &lt;/P&gt;

&lt;P&gt;index=myIndex UniqueReqId IN [002cc2c7-b1e4-49de-bbd3-caa6c2e741e3,00426627-98cf-4dd5-97b6-af4cde045286,00426627-98cf-4dd5-97b6-af4cde0452dsd,etc]&lt;/P&gt;

&lt;P&gt;I searched a lot but did not get the solution for my requirement however got the solution for single value subsearch output as input for main search.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Wasim&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 10:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323617#M96620</guid>
      <dc:creator>mdwasimkhan</dc:creator>
      <dc:date>2017-07-24T10:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323618#M96621</link>
      <description>&lt;P&gt;Hi  mdwasimkhan,&lt;BR /&gt;
If I correctly understood, try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex MyLogger [ search index=myIndex UniqueReqId | eval UniqueReqId=upper(UniqueReqId) | dedup UniqueReqId | fields UniqueReqId ]
| stats count as "Total user" by UniqueReqId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this way you have the event count for each user.&lt;BR /&gt;
beware that UniqueReqId  field must have the same name in both the searches.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 12:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323618#M96621</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-24T12:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323619#M96622</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex [ search index=myIndex MyLogger | dedup UniqueReqId | fields UniqueReqId ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jul 2017 22:00:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323619#M96622</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-24T22:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323620#M96623</link>
      <description>&lt;P&gt;Actually I have 2 below logger, In that common field is UniqueReqId only.&lt;/P&gt;

&lt;P&gt;LOGGER([UniqueReqId]+[MyLogger])&lt;BR /&gt;
LOGGER([UniqueReqId]+[userName]+[Action])&lt;/P&gt;

&lt;P&gt;So my requirement is i need to find out the UniqueReqId which contains MyLogger.[ This i want to search in sub-search block.]&lt;/P&gt;

&lt;P&gt;once i will get the &lt;BR /&gt;
all possible UniqueReqId in sub-search then We need to find out the userName who is using action=myAction and UniqueReqId=[Multiple UniqueReqId from subsearch].&lt;BR /&gt;
So fetch the userName from all possible UniqueReqId got from subsearch where action=myAction.&lt;/P&gt;

&lt;P&gt;We have multiple actions, so action=MyAction and UniqueReqId=(02191c34-b485,0228ff59,02be90c8,02e2ef7f etc)&lt;/P&gt;

&lt;P&gt;MyLogger is not require here, because it does not apear in other logger.&lt;/P&gt;

&lt;P&gt;Below command is working fine for me. Thanks Giuseppe &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;index=myIndex [ search index=myIndex MyLogger | dedup UniqueReqId | fields UniqueReqId ]&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 11:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323620#M96623</guid>
      <dc:creator>mdwasimkhan</dc:creator>
      <dc:date>2017-07-25T11:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323621#M96624</link>
      <description>&lt;P&gt;Yes, This is what i was looking for.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323621#M96624</guid>
      <dc:creator>mdwasimkhan</dc:creator>
      <dc:date>2017-07-25T12:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323622#M96625</link>
      <description>&lt;P&gt;I downvoted this post because below is the expected query : &lt;/P&gt;

&lt;P&gt;index=myindex [ search index=myindex mylogger | dedup uniquereqid | fields uniquereqid ]&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/323622#M96625</guid>
      <dc:creator>mdwasimkhan</dc:creator>
      <dc:date>2017-07-25T12:31:06Z</dc:date>
    </item>
  </channel>
</rss>

