<?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 How to search for a field value that has appeared as the value of some other field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11815#M838</link>
    <description>&lt;P&gt;I have a simple case where I want to see if the value of one field has shown up as the value of another field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rec=dns a=3.4.2.3
rec=dns a=5.1.2.3
rec=tcpsession server=5.1.2.3
rec=tcpsession server=3.4.2.3
rec=tcpsession server=6.3.2.4
rec=tcpsession server=5.6.7.8
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;intended search: (show me rec=tcpsession events in which server=(some value that has shown up as the value of "a" in a "rec=dns" event)&lt;/P&gt;

&lt;P&gt;intended results:
rec=tcpsession server=5.1.2.3
rec=tcpsession server=3.4.2.3&lt;/P&gt;

&lt;P&gt;transaction seems to be one way, but i'm looking for a simpler search structure that doesn't require rex.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Apr 2010 05:51:59 GMT</pubDate>
    <dc:creator>the_wolverine</dc:creator>
    <dc:date>2010-04-20T05:51:59Z</dc:date>
    <item>
      <title>How to search for a field value that has appeared as the value of some other field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11815#M838</link>
      <description>&lt;P&gt;I have a simple case where I want to see if the value of one field has shown up as the value of another field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rec=dns a=3.4.2.3
rec=dns a=5.1.2.3
rec=tcpsession server=5.1.2.3
rec=tcpsession server=3.4.2.3
rec=tcpsession server=6.3.2.4
rec=tcpsession server=5.6.7.8
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;intended search: (show me rec=tcpsession events in which server=(some value that has shown up as the value of "a" in a "rec=dns" event)&lt;/P&gt;

&lt;P&gt;intended results:
rec=tcpsession server=5.1.2.3
rec=tcpsession server=3.4.2.3&lt;/P&gt;

&lt;P&gt;transaction seems to be one way, but i'm looking for a simpler search structure that doesn't require rex.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2010 05:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11815#M838</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2010-04-20T05:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for a field value that has appeared as the value of some other field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11816#M839</link>
      <description>&lt;P&gt;You should use subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rec=tcpsession [ search rec=dns | dedup a | fields a | rename a as server ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will work for the number of distinct values of &lt;CODE&gt;a&lt;/CODE&gt; up to the limit of the &lt;CODE&gt;format&lt;/CODE&gt; command, which by default is 100.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2010 06:51:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11816#M839</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-20T06:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for a field value that has appeared as the value of some other field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11817#M840</link>
      <description>&lt;P&gt;If the limits of the subsearch are an issue you can do a similar thing just with stats. There's probably a less heavyhanded way to do this and still use stats, but if you really just want the list of servers at the end of the day, this will do it too: &lt;/P&gt;

&lt;P&gt;rename a as server | stats values(rec) as multi_valued_rec by server | where multi_valued_rec="dns" &lt;/P&gt;

&lt;P&gt;rename the a values to server. 
We do this so we can end up with uniform 'server' fields in the results. 
Then our stats can do a 'by server', so we'll end up with one ip address per row, and a multivalued field called 'multivalued_rec'.    Where (and even stats itself) are perfectly capable of dealing with multivalued fields so we just filter the ip list with a where clause and there you go. &lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2010 13:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11817#M840</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-04-23T13:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for a field value that has appeared as the value of some other field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11818#M841</link>
      <description>&lt;P&gt;probably want &lt;CODE&gt;... | where multi_valued_rec="dns" AND multi_valued_rec="tcpsession"&lt;/CODE&gt; at the end in this case. and just to be explicit, the initial search term before the rename would be &lt;CODE&gt;rec=dns OR rec=tcpsession | ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2010 13:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-a-field-value-that-has-appeared-as-the-value/m-p/11818#M841</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-23T13:25:22Z</dc:date>
    </item>
  </channel>
</rss>

