<?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: search one index with sourcetype from another index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53863#M13127</link>
    <description>&lt;P&gt;Nick, this search works and I can use it.&lt;/P&gt;

&lt;P&gt;The proxy events have there fields that could potable match the string from the subsearch (Referer, dest_server_suppiername, dest_host) The two important ones are (the Referer and the dest_host). I guess I could do a join first on dest_host then a seperet search to join on Referer.&lt;/P&gt;

&lt;P&gt;It would be nice to do just one search and know that an event discovered was discovered using the domain_name=foo.bar.xxx from index=foo&lt;/P&gt;

&lt;P&gt;Let me know if you have any more great advice&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:02:50 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2020-09-28T14:02:50Z</dc:date>
    <item>
      <title>search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53854#M13118</link>
      <description>&lt;P&gt;I have an index with several thousand entries, like a lookup table.  I would like to use these entries to search my proxy logs for a match.&lt;/P&gt;

&lt;P&gt;I would like to have the output show the value from the original index and the matching data from the proxy logs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=proxy  dest_host=* [| search index=foo sourctype=domain_name ] | top domain_name dest_host
OR 
sourcetype=proxy dest_host=* [| search index=foo sourcetype=domain_name | rename domain_name AS query | fields query ] | top dest_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't seem to get it right.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2013 19:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53854#M13118</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-06-03T19:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53855#M13119</link>
      <description>&lt;P&gt;If your intention is to search the "foo" index for the "domain_name" sourcetype and then use the "domain_name" value as a free text search against the "proxy" sourcetype,   then here you go: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=proxy  dest_host=* [search index=foo sourcetype=domain_name | fields domain_name | rename domain_name as search | fields search ] | top domain_name dest_host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You were close - you just have to have &lt;EM&gt;only&lt;/EM&gt; the search field in the subsearch pipeline.   Otherwise I think it yields out all the fields as kv pairs, &lt;EM&gt;plus&lt;/EM&gt; your one raw-text search term.  &lt;CODE&gt;( someField="someValue" zomg_the_domain_name someOtherField="someOtherValue" )&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53855#M13119</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-09-28T14:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53856#M13120</link>
      <description>&lt;P&gt;Nick, good to hear from you thanks for helping&lt;BR /&gt;
I haven't had ample time to really try this but on the first few tries this did not work.  It showed zero results in too short a search time.  almost like the search for proxy event was blank&lt;BR /&gt;
The sourcetype=domain_name has a field called name=*.google.com there are 4000 of these name fields&lt;BR /&gt;
I want to use the name field to search the proxy events to find matches so I want the see the matches from the proxy and the field that it matched on from the foo index&lt;BR /&gt;
top name dest_host&lt;BR /&gt;
I ajusted the search you gave me above to use name but got Zero results&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53856#M13120</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2020-09-28T14:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53857#M13121</link>
      <description>&lt;P&gt;Nick,&lt;/P&gt;

&lt;P&gt;I've done some more testing and when I pass the field from the subsearch "| reanme anme as search | fields search" and look for the field name of the string passed to the top level search the string has no field name to reference.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 16:14:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53857#M13121</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-06-04T16:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53858#M13122</link>
      <description>&lt;P&gt;so in the background I think it looks like this&lt;/P&gt;

&lt;P&gt;Sourcetype=proxy dest_host=* "name1" OR "name2" OR name3" OR "name4" | top name dest_host&lt;/P&gt;

&lt;P&gt;there is no field with the fieldname of "name" only string searchs&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53858#M13122</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2020-09-28T14:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53859#M13123</link>
      <description>&lt;P&gt;Well I made some assumptions in my answer, filling in ambiguities in your question.  Notably in my sentence beginning with "If your intention is",  note that I said it would do free text searches on the values,  not fieldName="value" searches.   Can you spell out more explicitly what exactly you're trying to do.   I gather you want to search for these values as the values of a field in the proxy sourcetype?   What is the field name?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 17:17:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53859#M13123</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-06-04T17:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53860#M13124</link>
      <description>&lt;P&gt;Thanks again for helping,&lt;/P&gt;

&lt;P&gt;I know I'm not saying it quit right but lets see if I can explain.&lt;/P&gt;

&lt;P&gt;I have an index with over 4000 domain names that I want to use to search the proxy events as a string to see if any part of the proxy event is a match.  The problem is that in the proxy event there are several domain names and if I look at the proxy event I have no way of knowing what the original sting search was.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 21:08:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53860#M13124</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-06-04T21:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53861#M13125</link>
      <description>&lt;P&gt;In short I wanted the pass the field tag or some tag that would identify which string was used to match the event in the proxy log.&lt;/P&gt;

&lt;P&gt;I could do a join with the two indexes but that only matches one field in both indexes&lt;/P&gt;

&lt;P&gt;Thanks so much for your help.  Let me know if this makes any sense at all.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 21:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53861#M13125</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-06-04T21:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53862#M13126</link>
      <description>&lt;P&gt;OK. If there's no "domain_name" field in the proxy logs, then that was a bad assumption on my part.    How about: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=proxy  dest_host=* [search index=foo sourcetype=domain_name | rename domain_name as search | fields search] | top dest_host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;As far as preserving some indicator for &lt;EM&gt;which&lt;/EM&gt; field the text-searches matched in each proxy event, is there some discrete set of extracted fields that it &lt;EM&gt;could&lt;/EM&gt; match in the proxy log data?   Or do you not have any idea what the matching fieldname(s) in the proxy logs might be?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 22:08:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53862#M13126</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-06-04T22:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: search one index with sourcetype from another index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53863#M13127</link>
      <description>&lt;P&gt;Nick, this search works and I can use it.&lt;/P&gt;

&lt;P&gt;The proxy events have there fields that could potable match the string from the subsearch (Referer, dest_server_suppiername, dest_host) The two important ones are (the Referer and the dest_host). I guess I could do a join first on dest_host then a seperet search to join on Referer.&lt;/P&gt;

&lt;P&gt;It would be nice to do just one search and know that an event discovered was discovered using the domain_name=foo.bar.xxx from index=foo&lt;/P&gt;

&lt;P&gt;Let me know if you have any more great advice&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-one-index-with-sourcetype-from-another-index/m-p/53863#M13127</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2020-09-28T14:02:50Z</dc:date>
    </item>
  </channel>
</rss>

