<?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 Regex for Inputs.conf to grab hostname challenge in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-Inputs-conf-to-grab-hostname-challenge/m-p/78487#M19855</link>
    <description>&lt;P&gt;I am trying to pull the hostname from file names, for inputs.conf. The hostname is always between the second and third set of double underscore characters the rest of the file name can be multiple groups of letters &amp;amp; numbers.&lt;BR /&gt;
The hostname can be made up of letters, numbers, and/or dashes&lt;BR /&gt;
If the hostname has dashes then there can be two, three, or four segments to the name, but it is always the total of what's between the double underscore.&lt;BR /&gt;
There can be multiple segments to the file name, both before and after the hostname.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;field____field________field__________hostname_______field.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jun 2012 15:46:14 GMT</pubDate>
    <dc:creator>conner9</dc:creator>
    <dc:date>2012-06-19T15:46:14Z</dc:date>
    <item>
      <title>Regex for Inputs.conf to grab hostname challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-Inputs-conf-to-grab-hostname-challenge/m-p/78487#M19855</link>
      <description>&lt;P&gt;I am trying to pull the hostname from file names, for inputs.conf. The hostname is always between the second and third set of double underscore characters the rest of the file name can be multiple groups of letters &amp;amp; numbers.&lt;BR /&gt;
The hostname can be made up of letters, numbers, and/or dashes&lt;BR /&gt;
If the hostname has dashes then there can be two, three, or four segments to the name, but it is always the total of what's between the double underscore.&lt;BR /&gt;
There can be multiple segments to the file name, both before and after the hostname.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;field____field________field__________hostname_______field.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2012 15:46:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-Inputs-conf-to-grab-hostname-challenge/m-p/78487#M19855</guid>
      <dc:creator>conner9</dc:creator>
      <dc:date>2012-06-19T15:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for Inputs.conf to grab hostname challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-Inputs-conf-to-grab-hostname-challenge/m-p/78488#M19856</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_regex =__((?:[a-zA-Z0-9]|-)+)__
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which says "use the string between the double-underscores, if that string consists only of any combination of letters, numbers and dashes"&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2012 00:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-Inputs-conf-to-grab-hostname-challenge/m-p/78488#M19856</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-06-20T00:48:21Z</dc:date>
    </item>
  </channel>
</rss>

