<?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: Extracting hostname from filename - inputs.conf on UF - host_regex issue in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69133#M13985</link>
    <description>&lt;P&gt;There may also be some metadata rewrites happening, depending on the sourcetype (for example, the syslog sourcetype has built in rewrites).&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2013 13:08:25 GMT</pubDate>
    <dc:creator>dshpritz</dc:creator>
    <dc:date>2013-03-21T13:08:25Z</dc:date>
    <item>
      <title>Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131#M13983</link>
      <description>&lt;P&gt;Having an issue with bluecoat logs that are dropped on a server with a UF.  Attempting to extract the hostname with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_regex = /logs/rsyslog/bclogs/(.*)-\d{6}[.]log[.]gz
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Checked this regex in regexr and it works perfectly.  &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Sample file names - Host format  (ABC-G-PXYW-XXX)&lt;/P&gt;

&lt;P&gt;/logs/rsyslog/bclogs/ABC-G-PXYW-002-032016.log.gz&lt;BR /&gt;
/logs/rsyslog/bclogs/AEC-G-PXYW-001-032016.log.gz&lt;BR /&gt;
/logs/rsyslog/bclogs/ABC-G-PXYW-002-032014.log.gz&lt;BR /&gt;
/logs/rsyslog/bclogs/DEF-G-PXYW-003-032016.log.gz&lt;/P&gt;

&lt;P&gt;The host is coming in set as the name of the log server, rather than the name.&lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 00:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131#M13983</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-03-21T00:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69132#M13984</link>
      <description>&lt;P&gt;You're not changing the &lt;CODE&gt;source&lt;/CODE&gt; are you? See below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_regex = &amp;lt;regular expression&amp;gt;
* If specified, &amp;lt;regular expression&amp;gt; extracts host from the path to the file for each input file. 
    * Detail: This feature examines the source key, so if source is set
      explicitly in the stanza, that string will be matched, not the original filename.
* Specifically, the first group of the regex is used as the host. 
* If the regex fails to match, the default "host =" attribute is used.
* If host_regex and host_segment are both set, host_regex will be ignored.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please post the full &lt;CODE&gt;inputs.conf&lt;/CODE&gt; stanza for the bc logs.&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 01:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69132#M13984</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-03-21T01:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69133#M13985</link>
      <description>&lt;P&gt;There may also be some metadata rewrites happening, depending on the sourcetype (for example, the syslog sourcetype has built in rewrites).&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 13:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69133#M13985</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2013-03-21T13:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69134#M13986</link>
      <description>&lt;H2&gt;This is the current inputs.conf on the Universal Forwarder&lt;/H2&gt;

&lt;P&gt;index = proxysg&lt;BR /&gt;
sourcetype = squid&lt;BR /&gt;
ignoreOlderThan = 60m&lt;BR /&gt;
disabled = false&lt;BR /&gt;
host_regex = /logs/rsyslog/bclogs/(.*)-\d{6}[.]log[.]gz&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69134#M13986</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-03-21T14:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69135#M13987</link>
      <description>&lt;P&gt;the site is ripping out the backslashes...&lt;/P&gt;

&lt;P&gt;"^\/logs\/rsyslog\/bclogs\/(.*)-\d{6}[.]log[.]gz"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 16:39:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69135#M13987</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-03-21T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69136#M13988</link>
      <description>&lt;P&gt;You need two backlashes for it to display correctly on Splunkbase:&lt;BR /&gt;
host_regex = ^/logs/rsyslog/bclogs/(.*)-\d{6}[.]log[.]gz&lt;/P&gt;

&lt;P&gt;(bitten me tons of times)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 16:39:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69136#M13988</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2013-03-21T16:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69137#M13989</link>
      <description>&lt;P&gt;Try this one more time.&lt;BR /&gt;
"^\/logs\/rsyslog\/bclogs\/(.*)-d{6}[.]log[.]gz"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 16:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69137#M13989</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-03-21T16:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69138#M13990</link>
      <description>&lt;P&gt;Just for a sanity check, has the UF been restarted? The regex looks correct. The other thought is that the system doing the parsing (Heavy Forwarder or Indexer) is overwriting it.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 17:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69138#M13990</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2013-03-21T17:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69139#M13991</link>
      <description>&lt;P&gt;If you've restarted your forwarder and don't have any host overrides on your parser/indexer, your regex should work.  As should something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_regex=/logs/rsyslog/bclogs/([\w-]+)(?=-\d{6}\.log\.gz)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2013 17:44:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69139#M13991</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2013-03-21T17:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting hostname from filename - inputs.conf on UF - host_regex issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69140#M13992</link>
      <description>&lt;P&gt;That worked with the "/"&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 19:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69140#M13992</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-03-21T19:06:39Z</dc:date>
    </item>
  </channel>
</rss>

