<?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 Good Way to Add Site Specific Metadata in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18057#M2579</link>
    <description>&lt;P&gt;Hi Folks,&lt;/P&gt;

&lt;P&gt;I'd appreciate any advice on a good way to add site specific information to events.  I have a distributed setup with multiple indexers per location, and multiple locations.  The index names are the same across all of the indexers.&lt;/P&gt;

&lt;P&gt;For example, let's say I have a datacenter in ny and one in la.  Each of these has 3 indexers.  I want to be able to search across all of them as well as limit my search to just ny or just la.  There is nothing in the data that denotes which location the event took place in.  I also don't want to have to know the hostnames of the splunk indexers in order to perform the localized search.&lt;/P&gt;

&lt;P&gt;I was thinking of adding an indexed field in a similar fashion to this thread: &lt;A href="http://answers.splunk.com/questions/1453/how-do-i-add-metadata-to-events-coming-from-a-splunk-forwarder" rel="nofollow"&gt;http://answers.splunk.com/questions/1453/how-do-i-add-metadata-to-events-coming-from-a-splunk-forwarder&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Are there any other alternatives?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Dec 2010 10:38:55 GMT</pubDate>
    <dc:creator>infrauser</dc:creator>
    <dc:date>2010-12-24T10:38:55Z</dc:date>
    <item>
      <title>Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18057#M2579</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;

&lt;P&gt;I'd appreciate any advice on a good way to add site specific information to events.  I have a distributed setup with multiple indexers per location, and multiple locations.  The index names are the same across all of the indexers.&lt;/P&gt;

&lt;P&gt;For example, let's say I have a datacenter in ny and one in la.  Each of these has 3 indexers.  I want to be able to search across all of them as well as limit my search to just ny or just la.  There is nothing in the data that denotes which location the event took place in.  I also don't want to have to know the hostnames of the splunk indexers in order to perform the localized search.&lt;/P&gt;

&lt;P&gt;I was thinking of adding an indexed field in a similar fashion to this thread: &lt;A href="http://answers.splunk.com/questions/1453/how-do-i-add-metadata-to-events-coming-from-a-splunk-forwarder" rel="nofollow"&gt;http://answers.splunk.com/questions/1453/how-do-i-add-metadata-to-events-coming-from-a-splunk-forwarder&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Are there any other alternatives?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2010 10:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18057#M2579</guid>
      <dc:creator>infrauser</dc:creator>
      <dc:date>2010-12-24T10:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18058#M2580</link>
      <description>&lt;P&gt;Several possible approaches. Just be sure to test and proceed with caution, especially if choosing option I or III.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
&lt;B&gt;Option I: Create a separate index for each site.&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;For each site, create a new index with a name matching the site.&lt;/P&gt;

&lt;P&gt;Then just set the list of which ones should be searched by default, either by setting &lt;CODE&gt;srchIndexesDefault&lt;/CODE&gt; in authorize.conf or through the Manager's Role settings. See &lt;A href="http://answers.splunk.com/questions/2513/how-do-i-set-the-default-index" rel="nofollow"&gt;How do I Set the Default Index?&lt;/A&gt; and &lt;A href="http://www.splunk.com/base/Documentation/latest/admin/Authorizeconf" rel="nofollow"&gt;authorize.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Now, you can search on &lt;CODE&gt;index=NY&lt;/CODE&gt;, etc.&lt;/P&gt;

&lt;P&gt;For existing data, you can re-index, but you probably don't need to. Take a look at this thread for some hints on moving data into a new index. Or, you can just live with the existing data in the default &lt;CODE&gt;main&lt;/CODE&gt; index until it ages out.&lt;/P&gt;

&lt;P&gt;See here for more information:&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;A href="http://answers.splunk.com/questions/5479/how-to-rename-an-index" rel="nofollow"&gt;http://answers.splunk.com/questions/5479/how-to-rename-an-index&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;I&gt;Note that the link is for version 4.1.4 and earlier. I suspect that it will still work, but have not verified -- there may be other implications depending on version&lt;/I&gt;.&lt;/P&gt;

&lt;P&gt;Since this can impact your existing data, you'll definitely want to test ahead of time and verify that your procedure works as you expect. It would also be a good idea to contact Splunk support and ask them to review your plan.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
&lt;B&gt;Option II: Create an eventtype for each site.&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;You still need to know the hostnames initially, but once it's configured you will only need to update the eventtype definition when things change.&lt;/P&gt;

&lt;P&gt;Technically, this still requires identifying a list of hosts or other criteria per-site, but now you only have to manage it at the eventtype level, not per-search or per-view.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
&lt;B&gt;Option III:  Create an indexed field&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Usually not recommended, but may work well in your situation.  It will increase the size of the index somewhat and &lt;I&gt;could&lt;/I&gt; have implications for search performance. And, of course, it's a mostly permanent choice.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
&lt;B&gt;Option IV: Use a lookup table to map between host and site&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Listed only for completeness. This option sounds good in theory, but is likely to kill performance, since trying to search by site will likely scan across all events before triggering the lookup. It technically accomplishes what you want, but will utterly destroy perfomance. &lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
&lt;B&gt;Option V:  Adopt a naming convention for hosts that includes site, or use IP addresses for &lt;I&gt;host&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Probably not realistic, but worth mentioning.  If, e.g., all of your LA machines are named 'LA-XXXXX' or have an ip address in 10.1.2.XXX, then it's easy to do a search on &lt;CODE&gt;host="LA-*"&lt;/CODE&gt; or similar.&lt;/P&gt;

&lt;P&gt;If you decide to go this route, you can use a lookup (scripted or static) to resolve the hostname for display purposes. It does create significant performance issues if you want to regularly search based on hostname.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2010 11:20:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18058#M2580</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-12-24T11:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18059#M2581</link>
      <description>&lt;P&gt;In a case like this, where there is a presumably small number of distinct values of the indexed field, it will probably be fine to use an indexed field&lt;/P&gt;

&lt;P&gt;Also, southeringtonp's Option IV should work very well in fact if you are using an automatic CSV lookup table mapping hosts to site. Splunk will automatically do a reverse lookup on the site name, expand to the host name. In fact, this would be preferable (and easier to maintain) than using Option II with eventtypes.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2010 07:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18059#M2581</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-12-25T07:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18060#M2582</link>
      <description>&lt;P&gt;Option IV should be preferred over Option II with an automatic file-based lookup. Splunk will internally perform a reverse lookup, such that &lt;CODE&gt;site=x&lt;/CODE&gt; will be expanded into &lt;CODE&gt;(host=h1 OR host=h2 ...)&lt;/CODE&gt;, so performance should be the same for searching as with eventtypes or macros.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2010 08:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18060#M2582</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-12-25T08:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18061#M2583</link>
      <description>&lt;P&gt;Plus, it's easier to maintain a CSV table than the eventtypes.conf file.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2010 08:07:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18061#M2583</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-12-25T08:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18062#M2584</link>
      <description>&lt;P&gt;Nice! I had assumed that the CSV lookup wouldn't take place in time for the check against the index - that makes a huge difference.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2010 10:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18062#M2584</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-12-25T10:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18063#M2585</link>
      <description>&lt;P&gt;Thanks for the info.  I'll definitely check a couple of these out.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2010 02:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18063#M2585</guid>
      <dc:creator>infrauser</dc:creator>
      <dc:date>2010-12-31T02:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Good Way to Add Site Specific Metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18064#M2586</link>
      <description>&lt;P&gt;This is nice to know as well.  Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2010 02:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Good-Way-to-Add-Site-Specific-Metadata/m-p/18064#M2586</guid>
      <dc:creator>infrauser</dc:creator>
      <dc:date>2010-12-31T02:17:34Z</dc:date>
    </item>
  </channel>
</rss>

