<?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 Query to get the result from one sourcetype and get other field values based on the output from other sourcetype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655156#M226328</link>
    <description>&lt;P&gt;Need help in creating a query to get the result from one sourcetype and get other field values based on the output from the first sourcetype.&lt;/P&gt;&lt;P&gt;For. e.g&lt;/P&gt;&lt;P&gt;I am having the below output which shows the transaction_id as a result but the username corresponding to that transaction ID should be fetched from another sourcetype.&lt;/P&gt;&lt;P&gt;Result of query should be -&amp;nbsp;&lt;/P&gt;&lt;P&gt;_time hostname transaction_id username city&lt;BR /&gt;1:30AM server1 TEST cron_user US&lt;/P&gt;&lt;P&gt;1:31AM server2 TEST1 cron2_user CA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In above transaction_id is the field present in both sourcetype&lt;/P&gt;&lt;P&gt;hostname and transaction_id is coming from one sourcetype.&lt;/P&gt;&lt;P&gt;matching with specfific transaction_id , username and city should be fetched from sourcetype2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2023 11:08:02 GMT</pubDate>
    <dc:creator>sahil237888</dc:creator>
    <dc:date>2023-08-22T11:08:02Z</dc:date>
    <item>
      <title>Query to get the result from one sourcetype and get other field values based on the output from other sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655156#M226328</link>
      <description>&lt;P&gt;Need help in creating a query to get the result from one sourcetype and get other field values based on the output from the first sourcetype.&lt;/P&gt;&lt;P&gt;For. e.g&lt;/P&gt;&lt;P&gt;I am having the below output which shows the transaction_id as a result but the username corresponding to that transaction ID should be fetched from another sourcetype.&lt;/P&gt;&lt;P&gt;Result of query should be -&amp;nbsp;&lt;/P&gt;&lt;P&gt;_time hostname transaction_id username city&lt;BR /&gt;1:30AM server1 TEST cron_user US&lt;/P&gt;&lt;P&gt;1:31AM server2 TEST1 cron2_user CA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In above transaction_id is the field present in both sourcetype&lt;/P&gt;&lt;P&gt;hostname and transaction_id is coming from one sourcetype.&lt;/P&gt;&lt;P&gt;matching with specfific transaction_id , username and city should be fetched from sourcetype2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 11:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655156#M226328</guid>
      <dc:creator>sahil237888</dc:creator>
      <dc:date>2023-08-22T11:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Query to get the result from one sourcetype and get other field values based on the output from other sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655158#M226329</link>
      <description>&lt;P&gt;Your transaction ids don't match, but assuming they did, you could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval hostname=if(sourcetype="sourcetype1",hostname,null())
| eval user=if(sourcetype="sourcetype2",user,null())
| eval city=if(sourcetype="sourcetype2",city,null())
| stats values(hostname) as hostname values(user) as user values(city) as city by transaction_id&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 22 Aug 2023 11:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655158#M226329</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-22T11:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Query to get the result from one sourcetype and get other field values based on the output from other sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655268#M226362</link>
      <description>&lt;P&gt;Something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype IN (sourcetype1, sourcetype2)
| stats max(_time) as _time values(hostname) as hostname values(username) as username values(city) as city by transaction_id&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Aug 2023 07:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-get-the-result-from-one-sourcetype-and-get-other-field/m-p/655268#M226362</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-23T07:14:25Z</dc:date>
    </item>
  </channel>
</rss>

