<?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: Using tags to search other fields in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70502#M653</link>
    <description>&lt;P&gt;Thanks for this.  However I don't think it will work since it is still looking into the "host=ip1" as the log source and just returning that value as something to pass from the subsearch.  What I need is a search to look into the values of all defined in the tag and pass them to the main search.&lt;/P&gt;

&lt;P&gt;It looks like lookup table is the way to go.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2013 16:12:07 GMT</pubDate>
    <dc:creator>mcm10285</dc:creator>
    <dc:date>2013-03-22T16:12:07Z</dc:date>
    <item>
      <title>Using tags to search other fields</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70500#M651</link>
      <description>&lt;P&gt;I'm trying to find a way to use tags to be used in search as such that the tag entries are cross-matched to the search.  This would sound like a job for lookups but is there a way to use the tag?&lt;/P&gt;

&lt;P&gt;I found this link (below), but I'm not sure it works for me or if I did anything wrong.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    eventtype=foo [search tag::host=tagname | dedup host | fields host | rename host as foo_field]...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/1325/using-host-tags-or-similar-when-searching-on-fields"&gt;http://splunk-base.splunk.com/answers/1325/using-host-tags-or-similar-when-searching-on-fields&lt;/A&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;My objective: To get the same result as the search below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo ip1 OR ip2 OR ip3|table foo_field field1 field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;foo_field is a field from the eventtype that would correspond to the ip1, ip2, ip3, etc.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Given:  tagname: host=ip1, host=ip2, host=ip3&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Except for using lookup table, any other ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 19:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70500#M651</guid>
      <dc:creator>mcm10285</dc:creator>
      <dc:date>2013-03-21T19:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using tags to search other fields</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70501#M652</link>
      <description>&lt;P&gt;Assuming &lt;CODE&gt;search tag::host=tagname&lt;/CODE&gt; yields events from hosts ip1, ip2, and ip3, the first subsearch should build a search something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo (foo_field=ip1 OR foo_field=ip2 OR foo_field=ip3)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's different from your desired search &lt;CODE&gt;eventtype=foo ip1 OR ip2 OR ip3&lt;/CODE&gt;, for that you could modify the subsearch into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo [search tag::host=tagname | return $host]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will build a search something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo (ip1 OR ip2 OR ip3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2013 21:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70501#M652</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-21T21:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using tags to search other fields</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70502#M653</link>
      <description>&lt;P&gt;Thanks for this.  However I don't think it will work since it is still looking into the "host=ip1" as the log source and just returning that value as something to pass from the subsearch.  What I need is a search to look into the values of all defined in the tag and pass them to the main search.&lt;/P&gt;

&lt;P&gt;It looks like lookup table is the way to go.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2013 16:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70502#M653</guid>
      <dc:creator>mcm10285</dc:creator>
      <dc:date>2013-03-22T16:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using tags to search other fields</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70503#M654</link>
      <description>&lt;P&gt;I see, you want an entire list of tags... the REST API is the way to go then, using the rest command in the search language and this endpoint: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/RESTAPI/RESTknowledge#search.2Ftags.2F.7Btag_name.7D"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/RESTAPI/RESTknowledge#search.2Ftags.2F.7Btag_name.7D&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2013 16:35:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Using-tags-to-search-other-fields/m-p/70503#M654</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-22T16:35:29Z</dc:date>
    </item>
  </channel>
</rss>

