<?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: Retrieving data from one query and using it to find data from another in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710391#M239982</link>
    <description>&lt;P&gt;To receive help in Splunk search, it is best to give more concrete information, even if you use mock names and values.&lt;/P&gt;&lt;P&gt;Assuming the two different sources are sourcetype sourceA and sourceB. &amp;nbsp;The 3 parameters in sourceA are named "ID", "param2", and "param3". &amp;nbsp;Further assume that sourceB has the same field name "ID" to match that in sourceA, and that "actual name of the object" is in field named "name". &amp;nbsp;Assuming that all these fields are already extracted.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype IN (sourceA, sourceB)
| stats values(name) as name values(param2) as param2 values(param3) as param3 by ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Feb 2025 07:37:09 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2025-02-01T07:37:09Z</dc:date>
    <item>
      <title>Retrieving data from one query and using it to find data from another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710379#M239980</link>
      <description>&lt;P&gt;I have a query From source A that i need to get a list of 3 parameters back and for one of these parameters which is a ID and i need to get the the actual name of the object from another query from source B using this ID. Eventually i need&amp;nbsp; i want to create a table to print the 3 parameter including the name also. Any help would be greatly appreciated?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 22:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710379#M239980</guid>
      <dc:creator>momagic</dc:creator>
      <dc:date>2025-01-31T22:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving data from one query and using it to find data from another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710389#M239981</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276069"&gt;@momagic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to use a subsearch:&lt;/P&gt;&lt;P&gt;create a main query containing the data to display,&lt;/P&gt;&lt;P&gt;adding as subsearch (putting it between square brackets and adding the search command at the beginning) the search containing the parameters,&lt;/P&gt;&lt;P&gt;then you can display the fields you want.&lt;/P&gt;&lt;P&gt;You have to put attention to two things:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;at the end of the subsearch yo have to use a command as table or fields to list only the fields used as filters,&lt;/LI&gt;&lt;LI&gt;the fields from the subsearch must have exactly (case sensitive) the same names of the fields in the main search.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For example, if the fields to use to filter events are FieldA and FieldB but ib the subsearch there are also other fields, you should write:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 [ search index=index2 | fields FieldA FieldB ]
| table _time host field1 field2 FieldA FieldB&lt;/LI-CODE&gt;&lt;P&gt;If you haven't much experience on Splunk searches and you didn't followed a course (there are many free courses in Splunk), you could follow the Splunk Search Tutorial (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/SearchTutorial/WelcometotheSearchTutorial" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/SearchTutorial/WelcometotheSearchTutorial&lt;/A&gt;) that explain how to use Splunk for searching, and here you can find a description of how to use subsearches&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/SearchTutorial/Useasubsearch" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/SearchTutorial/Useasubsearch&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2025 06:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710389#M239981</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-02-01T06:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving data from one query and using it to find data from another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710391#M239982</link>
      <description>&lt;P&gt;To receive help in Splunk search, it is best to give more concrete information, even if you use mock names and values.&lt;/P&gt;&lt;P&gt;Assuming the two different sources are sourcetype sourceA and sourceB. &amp;nbsp;The 3 parameters in sourceA are named "ID", "param2", and "param3". &amp;nbsp;Further assume that sourceB has the same field name "ID" to match that in sourceA, and that "actual name of the object" is in field named "name". &amp;nbsp;Assuming that all these fields are already extracted.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype IN (sourceA, sourceB)
| stats values(name) as name values(param2) as param2 values(param3) as param3 by ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2025 07:37:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieving-data-from-one-query-and-using-it-to-find-data-from/m-p/710391#M239982</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-02-01T07:37:09Z</dc:date>
    </item>
  </channel>
</rss>

