<?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: Event Tagging - Auto Tag or Lookup in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76793#M15709</link>
    <description>&lt;P&gt;Generally, I would recommend using lookup tables (which operate on CSV files, which can be easily generated) rather than tags for something like this.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Oct 2010 22:00:35 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-10-25T22:00:35Z</dc:date>
    <item>
      <title>Event Tagging - Auto Tag or Lookup</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76792#M15708</link>
      <description>&lt;P&gt;Would like to have the hosts/sources tagged as they are implemented into the system rather than have to go through after the fact and select the specific hosts and then tag them at that time.&lt;/P&gt;

&lt;P&gt;I am wondering if anyone has written any scripting into Splunk that identifies a source from a lookup file or something similar and then populates the correct .conf file necessary.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;

&lt;P&gt;Answered - &lt;/P&gt;

&lt;P&gt;Generally, I would recommend using lookup tables (which operate on CSV files, which can be easily generated) rather than tags for something like this.&lt;/P&gt;

&lt;P&gt;Question - How would we implement the above answer?  I am not sure what they are referring to using lookup tables as opposed to tagging?&lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2010 22:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76792#M15708</guid>
      <dc:creator>travistrp</dc:creator>
      <dc:date>2010-10-25T22:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Event Tagging - Auto Tag or Lookup</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76793#M15709</link>
      <description>&lt;P&gt;Generally, I would recommend using lookup tables (which operate on CSV files, which can be easily generated) rather than tags for something like this.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2010 22:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76793#M15709</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-10-25T22:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Event Tagging - Auto Tag or Lookup</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76794#M15710</link>
      <description>&lt;P&gt;Can you explain or elaborate on the above comment please?  If it will work in the same method I am all for it?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2010 22:00:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76794#M15710</guid>
      <dc:creator>travistrp</dc:creator>
      <dc:date>2010-10-25T22:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Event Tagging - Auto Tag or Lookup</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76795#M15711</link>
      <description>&lt;P&gt;You can use a lookup table with tags for your different host names.&lt;/P&gt;

&lt;P&gt;For example, if you had a CSV table like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE&gt;host,host_tag
HostA,webserver
HostB,webserver
HostC,sqlserver
HostD,domaincontroller
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;You could then &lt;A href="http://www.splunk.com/base/Documentation/latest/Knowledge/Addfieldsfromexternaldatasources" rel="nofollow"&gt;create a lookup&lt;/A&gt; in splunk like the following:&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[hostlookup]
filename = mylookupfile.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::*]
lookup_hostlookup = hostlookup host OUTPUTNEW host_tag
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now what this will do, is that every search you run, for every event's host field splunk will look in your CSV table for the corresponding host_tag and output it as a new field. This also means that you could do a search like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_tag=webserver
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and it would return events from HostA and HostB.&lt;/P&gt;

&lt;P&gt;The lookup table is easy to update and keep current, a lot easier than working with a lot of Splunk tags.&lt;/P&gt;

&lt;P&gt;Post a comment if you have any questions.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2010 22:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-Tagging-Auto-Tag-or-Lookup/m-p/76795#M15711</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-10-25T22:15:07Z</dc:date>
    </item>
  </channel>
</rss>

