<?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: Help extracting hostname with host_regex from path in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478983#M82215</link>
    <description>&lt;P&gt;The first worked!&lt;BR /&gt;
The second put the path in the hostname.&lt;/P&gt;

&lt;P&gt;Seems like I needed to remove the "host" keyboard from the above.  I'm using Splunk Enterprise 7.1.2, if that matters.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 17:02:09 GMT</pubDate>
    <dc:creator>jelli5518</dc:creator>
    <dc:date>2019-11-06T17:02:09Z</dc:date>
    <item>
      <title>Help extracting hostname with host_regex from path</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478981#M82213</link>
      <description>&lt;P&gt;Log files are list this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/audit/files/any/path/host1.audittype-secure.timestamp.audit.log.1
/audit/files/hostab.audittype-audit.timestamp.txt
etc...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example:&lt;BR /&gt;
&lt;STRONG&gt;/audit/files/path/host123.secure.2019080165784.audit.log.1&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I want Splunk to have host as "host1" and "hostab" and "host123", and etc..&lt;/P&gt;

&lt;P&gt;I have this in inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///audit/files]
host_regex = \/S+([^.]).*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it isn't working at all.&lt;BR /&gt;&lt;BR /&gt;
I'm trying to set hostname to the string between the last / and the first.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 21:04:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478981#M82213</guid>
      <dc:creator>jelli5518</dc:creator>
      <dc:date>2019-11-05T21:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help extracting hostname with host_regex from path</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478982#M82214</link>
      <description>&lt;P&gt;try this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_regex = .*\/(host[^\.]+).*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_regex = \/(host[^\.]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2019 22:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478982#M82214</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-05T22:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help extracting hostname with host_regex from path</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478983#M82215</link>
      <description>&lt;P&gt;The first worked!&lt;BR /&gt;
The second put the path in the hostname.&lt;/P&gt;

&lt;P&gt;Seems like I needed to remove the "host" keyboard from the above.  I'm using Splunk Enterprise 7.1.2, if that matters.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 17:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478983#M82215</guid>
      <dc:creator>jelli5518</dc:creator>
      <dc:date>2019-11-06T17:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help extracting hostname with host_regex from path</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478984#M82216</link>
      <description>&lt;P&gt;You are welcome!&lt;BR /&gt;
Yeah &lt;CODE&gt;.*\/([^\.]+).*&lt;/CODE&gt; will also work. Please accept the answer if it works for you to close the question.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 17:24:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478984#M82216</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-06T17:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help extracting hostname with host_regex from path</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478985#M82217</link>
      <description>&lt;P&gt;My log files don't actually have the word "host" in them-- that was just an example.  Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 17:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-extracting-hostname-with-host-regex-from-path/m-p/478985#M82217</guid>
      <dc:creator>jelli5518</dc:creator>
      <dc:date>2019-11-06T17:37:49Z</dc:date>
    </item>
  </channel>
</rss>

