<?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: Host based on filename in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55613#M10873</link>
    <description>&lt;P&gt;FYI, and as a supplemental to the above answer, I keep my files in the following directory:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;/var/splunk/input/mms_logs/&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;The filename structure is:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;mms_&lt;I&gt;HOST-IP-ADDRESS&lt;/I&gt;_&lt;I&gt;TIMESTAMP&lt;/I&gt;.log&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;examples:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;mms_10.152.58.100_20110101_004000_06137.log&lt;BR /&gt;
mms_10.152.58.194_20110121_120000_70656.log&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Now to extract the IP address portion of filename as a host, I used the following regex:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;/var/splunk/input/mms_logs/mms_(\d+.\d+.\d+.\d+)_\d+&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Voila! From the above examples I know have two hosts (&lt;B&gt;10.152.58.100&lt;/B&gt; &amp;amp; &lt;B&gt;10.152.58.194&lt;/B&gt;), along with all of the events that are hosted within the files &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps someone!&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2011 09:24:42 GMT</pubDate>
    <dc:creator>rturk</dc:creator>
    <dc:date>2011-02-22T09:24:42Z</dc:date>
    <item>
      <title>Host based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55610#M10870</link>
      <description>&lt;P&gt;How can you create a "host" by the file name being indexed? Im looking to index my firewall configuration files, and currently the snapshots are saved with the firewalls hostname. Clear as mud?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2010 07:39:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55610#M10870</guid>
      <dc:creator>ehastings82</dc:creator>
      <dc:date>2010-09-22T07:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Host based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55611#M10871</link>
      <description>&lt;P&gt;You can look at the &lt;CODE&gt;host_segment&lt;/CODE&gt; and &lt;CODE&gt;host_regex&lt;/CODE&gt; settings that can be used with the file &lt;CODE&gt;monitor&lt;/CODE&gt; stanzas in inputs.conf, to extract the source host from the file path.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2010 07:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55611#M10871</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-09-22T07:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Host based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55612#M10872</link>
      <description>&lt;P&gt;Your the man!!!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2010 08:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55612#M10872</guid>
      <dc:creator>ehastings82</dc:creator>
      <dc:date>2010-09-22T08:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Host based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55613#M10873</link>
      <description>&lt;P&gt;FYI, and as a supplemental to the above answer, I keep my files in the following directory:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;/var/splunk/input/mms_logs/&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;The filename structure is:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;mms_&lt;I&gt;HOST-IP-ADDRESS&lt;/I&gt;_&lt;I&gt;TIMESTAMP&lt;/I&gt;.log&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;examples:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;mms_10.152.58.100_20110101_004000_06137.log&lt;BR /&gt;
mms_10.152.58.194_20110121_120000_70656.log&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Now to extract the IP address portion of filename as a host, I used the following regex:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;/var/splunk/input/mms_logs/mms_(\d+.\d+.\d+.\d+)_\d+&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Voila! From the above examples I know have two hosts (&lt;B&gt;10.152.58.100&lt;/B&gt; &amp;amp; &lt;B&gt;10.152.58.194&lt;/B&gt;), along with all of the events that are hosted within the files &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps someone!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2011 09:24:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Host-based-on-filename/m-p/55613#M10873</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2011-02-22T09:24:42Z</dc:date>
    </item>
  </channel>
</rss>

