<?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: Use field from one source to query another source in Security</title>
    <link>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75897#M14055</link>
    <description>&lt;P&gt;hello yannk!my first query (source ivr_history), I need the output to show host, sidnum &amp;amp; sessID. I am able to achieve this using this query:&lt;BR /&gt;
index=ivr sourcetype=ivr_history [search sourcetype=ivr_history "some data"| fields sidnum host sessID2]| table sidnum host sessID2| dedup sidnum host sessID2&lt;/P&gt;

&lt;P&gt;The 2nd query has a different source:ivr_sef.&lt;BR /&gt;
manually, i would run the query above and copy the sessID2 value and paste it into this query:&lt;BR /&gt;
 index=ivr sourcetype=ivr_sef "pasted sessID value here"| table id&lt;BR /&gt;
What I want to achieve is combine these 2 queries and remove the manual copy paste.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:51:49 GMT</pubDate>
    <dc:creator>mdacutanan</dc:creator>
    <dc:date>2020-09-28T14:51:49Z</dc:date>
    <item>
      <title>Use field from one source to query another source</title>
      <link>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75895#M14053</link>
      <description>&lt;P&gt;I am fairly new to Splunk and have had no formal training. I am having difficult time to take a field from one source as input to search another source. &lt;/P&gt;

&lt;P&gt;Here is my first query:&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;index=ivr sourcetype=ivr_history [search sourcetype=ivr_history "2062401185"| fields sidnum host]| stats values(sessID2) by host sidnum&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;OUTPUT of query above shows host, sidnum  and sessID2. Now, I want to search another source called ivr_sef. I want to use sessID2 to search source ivr_sef. if found, return the field  'id' (which should actually be same as sessID2).&lt;/P&gt;

&lt;P&gt;I modified my first query to this query below but the output for the id field comes out empty! I do know for a fact that the sessID value does exist in source ivr_sef (inside field id) because I have search it manually and separately beforehand. Please help!&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;index=ivr sourcetype=ivr_history OR ivr_sef [search sourcetype=ivr_history "2062401185"| fields sidnum host]| eval common=coalesce(sessID2, id)|stats values(sessID2) values(id) by host sidnum&lt;/P&gt;

&lt;HR /&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75895#M14053</guid>
      <dc:creator>mdacutanan</dc:creator>
      <dc:date>2020-09-28T14:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use field from one source to query another source</title>
      <link>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75896#M14054</link>
      <description>&lt;P&gt;your approach is the good one :&lt;BR /&gt;
use the result of a sub search to populate search conditions of the main search&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;conditionA=A [search othersearch| table conditionB]&lt;/CODE&gt;&lt;BR /&gt;
will become an equivalent of&lt;BR /&gt;
&lt;CODE&gt;conditionA=A AND (conditionB=B1 OR conditionB=B2 OR ..... OR conditionB=Bx )&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;so you may have a field  has different name in your 2 searches. (id or sidnum). You should attach a sample, and the the result of the sub search.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2013 01:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75896#M14054</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-09-28T01:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Use field from one source to query another source</title>
      <link>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75897#M14055</link>
      <description>&lt;P&gt;hello yannk!my first query (source ivr_history), I need the output to show host, sidnum &amp;amp; sessID. I am able to achieve this using this query:&lt;BR /&gt;
index=ivr sourcetype=ivr_history [search sourcetype=ivr_history "some data"| fields sidnum host sessID2]| table sidnum host sessID2| dedup sidnum host sessID2&lt;/P&gt;

&lt;P&gt;The 2nd query has a different source:ivr_sef.&lt;BR /&gt;
manually, i would run the query above and copy the sessID2 value and paste it into this query:&lt;BR /&gt;
 index=ivr sourcetype=ivr_sef "pasted sessID value here"| table id&lt;BR /&gt;
What I want to achieve is combine these 2 queries and remove the manual copy paste.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Use-field-from-one-source-to-query-another-source/m-p/75897#M14055</guid>
      <dc:creator>mdacutanan</dc:creator>
      <dc:date>2020-09-28T14:51:49Z</dc:date>
    </item>
  </channel>
</rss>

