<?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_regex problem in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128336#M26359</link>
    <description>&lt;P&gt;How would you put that in the inputs.conf?  Am I missing something?&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jul 2014 13:15:52 GMT</pubDate>
    <dc:creator>a212830</dc:creator>
    <dc:date>2014-07-02T13:15:52Z</dc:date>
    <item>
      <title>host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128333#M26356</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to parse the host from my logfile name, using host_regex, but it's not matching, and I'm unsure why.&lt;/P&gt;

&lt;P&gt;My host_regex setting is:  host_regex = \system-(.+).log$&lt;/P&gt;

&lt;P&gt;My files are in the format /apps/logs/YYYY/MM/DD/system-HOSTNAME.log&lt;/P&gt;

&lt;P&gt;The hostname can be anything - underscores, dashes, numbers, letters, uppercase, lowercase....  About the only two things that I would exclude would be spaces and special characters.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;/apps/logs/2014/07/02/system-ltmblahqa02.log&lt;BR /&gt;
/apps/logs/2014/07/02/system-ltmrEHH01-old.log&lt;BR /&gt;
/apps/logs/2014/07/02/system-sD-9k-99sum.log&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128333#M26356</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-28T16:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128334#M26357</link>
      <description>&lt;P&gt;I think your host_regex string is only missing a backslash to escape the '.log'.  This worked for me in RegExr:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;system-(?&amp;lt;hostname&amp;gt;[\S]+)\.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Jul 2014 13:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128334#M26357</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-02T13:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128335#M26358</link>
      <description>&lt;P&gt;The backslash shouldn't fix things, only disallow examples like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/apps/logs/2014/07/02/system-ltmblahqa02_log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Works for me with or without the backslash:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/regexr.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 13:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128335#M26358</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-02T13:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128336#M26359</link>
      <description>&lt;P&gt;How would you put that in the inputs.conf?  Am I missing something?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 13:15:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128336#M26359</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2014-07-02T13:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128337#M26360</link>
      <description>&lt;P&gt;Do post your entire inputs.conf stanza.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 13:16:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128337#M26360</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-02T13:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128338#M26361</link>
      <description>&lt;P&gt;If by "that" you mean martin_mueller's screen shot, don't worry about it.  He's showing I was incorrect about the need to escape periods.&lt;BR /&gt;
Put '&lt;CODE&gt;system-([\S]+).&lt;/CODE&gt;' as your host_regex string.  I've had better luck when I avoid matching on '.'.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:59:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128338#M26361</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-28T16:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128339#M26362</link>
      <description>&lt;P&gt;I hate to again nag about backslashes and dots, but in that case you'd need a backslash before the dot... else the no-spaces would match all the way to ".lo", and the dot would match the "g" &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I don't think the expression in and of itself is the issue. &lt;CODE&gt;a\d+&lt;/CODE&gt;, do post your entire inputs.conf stanza.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 17:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128339#M26362</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-02T17:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: host_regex problem</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128340#M26363</link>
      <description>&lt;P&gt;Thanks for setting me straight.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 17:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/host-regex-problem/m-p/128340#M26363</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-02T17:15:46Z</dc:date>
    </item>
  </channel>
</rss>

