<?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 use files got from one query as source in another query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588389#M204924</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please see my approach and adapt it to your use Case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc [ | search 
     index=abc source=.......
     | rex field=source "/A/B/C/(?&amp;lt;project_name&amp;gt;[^/]*)/(?&amp;lt;project_name_file&amp;gt;[^/]*)" 
     | stats latest(project_name_file) AS source BY project_name
     | fields source
     ]
| dedup name
| chart count(name) as count by "Number"&lt;/LI-CODE&gt;&lt;P&gt;in few words, using the first search to filter the second search results, you have to put the first search in a subsearch, then be sure that the key field has the same name in both main and subsearch: for this reason I renamed latest(project_name_file) AS source.&lt;/P&gt;&lt;P&gt;Beware if the&amp;nbsp;project_name_file has or not the full path that you should have in the source field of the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 11:05:40 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-03-10T11:05:40Z</dc:date>
    <item>
      <title>How to use files got as results from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588383#M204919</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have 2 queries, from one i get a list of files and the other query should use these files as their source to get some results. The output of first queries may have a lot files and i want to use all of them together in the second query. Does anyone have idea of how to do this one?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 15:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588383#M204919</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-03-10T15:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588385#M204921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_1 [ search your_search_2 | fields source ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;If you could share both your searches I could be more detailed.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588385#M204921</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-10T10:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588388#M204923</link>
      <description>&lt;P&gt;hi, this is the first query i m using to get the files. I want the recent file uploaded of the project. This will give the recent file name with the project name. I don't know if this is the right method to get recent file.&lt;/P&gt;&lt;P&gt;index=abc source=.......|rex field=source "/A/B/C/(?&amp;lt;project_name&amp;gt;[^/]*)/(?&amp;lt;project_name_file&amp;gt;[^/]*)" |stats latest(project_name_file) by project_name&lt;/P&gt;&lt;P&gt;The result will be having many files. I want to use all these files in another query.&lt;/P&gt;&lt;P&gt;index=abc source="All the files from previous query"|dedup name| chart count(name) as count by "Number"&lt;/P&gt;&lt;P&gt;I am not sure how to use all the files as source.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 11:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588388#M204923</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-03-10T11:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588389#M204924</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please see my approach and adapt it to your use Case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc [ | search 
     index=abc source=.......
     | rex field=source "/A/B/C/(?&amp;lt;project_name&amp;gt;[^/]*)/(?&amp;lt;project_name_file&amp;gt;[^/]*)" 
     | stats latest(project_name_file) AS source BY project_name
     | fields source
     ]
| dedup name
| chart count(name) as count by "Number"&lt;/LI-CODE&gt;&lt;P&gt;in few words, using the first search to filter the second search results, you have to put the first search in a subsearch, then be sure that the key field has the same name in both main and subsearch: for this reason I renamed latest(project_name_file) AS source.&lt;/P&gt;&lt;P&gt;Beware if the&amp;nbsp;project_name_file has or not the full path that you should have in the source field of the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 11:05:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588389#M204924</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-10T11:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588516#M204974</link>
      <description>&lt;P&gt;I am getting as no results found. Will i be able to use this query if the inner query has more than 1 file as output? Is it because of that giving as no results found?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 04:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588516#M204974</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-03-11T04:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588536#M204988</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said in my previous answer, probably the problem in in the format of the results, you should check the results of the two queries and see if they have the same format, e.g. have both the full path or not?&lt;/P&gt;&lt;P&gt;If they are different you have to modify the search to adapt to the different formats: e.g. use an asterisk or delete the full path and leave only the filename.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 07:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588536#M204988</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-11T07:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588707#M205016</link>
      <description>&lt;P&gt;Sorry.. missed that part. It is working fine now. Thanks a lot for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 11:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588707#M205016</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-03-11T11:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to use files got from one query as source in another query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588709#M205018</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 11:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-files-got-as-results-from-one-query-as-source-in/m-p/588709#M205018</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-11T11:43:57Z</dc:date>
    </item>
  </channel>
</rss>

