<?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 perform search among multiple instances based on instance name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-perform-search-among-multiple-instances-based-on-instance/m-p/194872#M56207</link>
    <description>&lt;P&gt;I run multiple instances of the same application on a server.  Each instance generates its own set of log files, and I want to be able to perform searches based on the instance.&lt;/P&gt;

&lt;P&gt;The log files are all located by the following path:&lt;BR /&gt;&lt;BR /&gt;
  /var/log/myapp/instances/&lt;INSTANCE&gt;/engine/engine*.log&lt;/INSTANCE&gt;&lt;/P&gt;

&lt;P&gt;I need a way to perform searches based on the instance name &lt;INSTANCE&gt;.  The instance name is NOT contained in the log data, only in the file path.&lt;/INSTANCE&gt;&lt;/P&gt;

&lt;P&gt;If I wanted to usurp the "host" field, I could use the features of inputs.conf that allow me to extract the host from the file path.  I am not sure this is a good solution for me, because I have multiple hosts doing this multiple instance thing and I would rather know the real host as well as the instance.&lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jun 2014 18:40:42 GMT</pubDate>
    <dc:creator>cdavistt</dc:creator>
    <dc:date>2014-06-10T18:40:42Z</dc:date>
    <item>
      <title>How to perform search among multiple instances based on instance name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perform-search-among-multiple-instances-based-on-instance/m-p/194872#M56207</link>
      <description>&lt;P&gt;I run multiple instances of the same application on a server.  Each instance generates its own set of log files, and I want to be able to perform searches based on the instance.&lt;/P&gt;

&lt;P&gt;The log files are all located by the following path:&lt;BR /&gt;&lt;BR /&gt;
  /var/log/myapp/instances/&lt;INSTANCE&gt;/engine/engine*.log&lt;/INSTANCE&gt;&lt;/P&gt;

&lt;P&gt;I need a way to perform searches based on the instance name &lt;INSTANCE&gt;.  The instance name is NOT contained in the log data, only in the file path.&lt;/INSTANCE&gt;&lt;/P&gt;

&lt;P&gt;If I wanted to usurp the "host" field, I could use the features of inputs.conf that allow me to extract the host from the file path.  I am not sure this is a good solution for me, because I have multiple hosts doing this multiple instance thing and I would rather know the real host as well as the instance.&lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 18:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perform-search-among-multiple-instances-based-on-instance/m-p/194872#M56207</guid>
      <dc:creator>cdavistt</dc:creator>
      <dc:date>2014-06-10T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform search among multiple instances based on instance name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perform-search-among-multiple-instances-based-on-instance/m-p/194873#M56208</link>
      <description>&lt;P&gt;The file name should show up in the &lt;CODE&gt;source&lt;/CODE&gt; field, so you might try something like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your-search-goes-here | rex field=source "/var/log/myapp/instances/(?&amp;lt;instance-name&amp;gt;\w+)/(.*)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This should pull out your instance name into a field called &lt;CODE&gt;instance-name&lt;/CODE&gt; that you can then work with.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 20:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perform-search-among-multiple-instances-based-on-instance/m-p/194873#M56208</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-06-10T20:03:31Z</dc:date>
    </item>
  </channel>
</rss>

