<?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: Extract Hostname using inputs.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221671#M43521</link>
    <description>&lt;P&gt;Set the event host with the host_segment attribute&lt;BR /&gt;
The host_segment value overrides the host field with a value that has been extracted from a segment in the path of your data source.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Edit inputs.conf in $SPLUNK_HOME/etc/system/local/ or in your own custom application directory in $SPLUNK_HOME/etc/apps/.&lt;/LI&gt;
&lt;LI&gt;Add a host_segment attribute to a stanza to override the host field with a value that has been extracted from a segment in the path of your data source. For example, if the path to the source is /var/log/ and you want the third segment (the host server name) to be the host value, set host_segment as follows:&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;`[monitor://var/log]&lt;/P&gt;

&lt;H1&gt;example - host_regex = /var/log/(\w+)&lt;/H1&gt;

&lt;P&gt;host_regex=\ &amp;lt;\w+\d+&amp;gt;` &lt;/P&gt;

&lt;P&gt;-Save the inputs.conf file.&lt;BR /&gt;
-Restart the Splunk instance.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.2/Data/Setadefaulthostforaninput" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.2/Data/Setadefaulthostforaninput&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:16:40 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2020-09-29T11:16:40Z</dc:date>
    <item>
      <title>Extract Hostname using inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221670#M43520</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the below event and I'd like to extract the hostname (ccivirpxa0720) using inputs.conf (never have done this before).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;####&amp;lt;Oct 4, 2016 10:01:23 AM EDT&amp;gt; &amp;lt;Warning&amp;gt; &amp;lt;ucontrol&amp;gt; &amp;lt;ccivirpxa0720&amp;gt; &amp;lt;managedServer11&amp;gt; &amp;lt;[ACTIVE] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'&amp;gt; &amp;lt;&amp;lt;anonymous&amp;gt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;1475589683462&amp;gt; &amp;lt;BEA-000000&amp;gt; &amp;lt;fn.webapp.listener.AuthenticationListener  - Authentication event AuthenticationFailureBadCredentialsEvent: gumbo1379; details: RemoteIpAddress: 10.210.192.15; SessionId: 0j2lXz2Tv11pNLL34bq2vtJN1h3SdvqbVnJpBNr7MDMqnc1TBtSJ!1472708347!1475589683460; exception: Bad credential; nested exception is org.springframework.security.BadCredentialsException: Bad credential&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Oct 2016 15:15:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221670#M43520</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-10-04T15:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Hostname using inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221671#M43521</link>
      <description>&lt;P&gt;Set the event host with the host_segment attribute&lt;BR /&gt;
The host_segment value overrides the host field with a value that has been extracted from a segment in the path of your data source.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Edit inputs.conf in $SPLUNK_HOME/etc/system/local/ or in your own custom application directory in $SPLUNK_HOME/etc/apps/.&lt;/LI&gt;
&lt;LI&gt;Add a host_segment attribute to a stanza to override the host field with a value that has been extracted from a segment in the path of your data source. For example, if the path to the source is /var/log/ and you want the third segment (the host server name) to be the host value, set host_segment as follows:&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;`[monitor://var/log]&lt;/P&gt;

&lt;H1&gt;example - host_regex = /var/log/(\w+)&lt;/H1&gt;

&lt;P&gt;host_regex=\ &amp;lt;\w+\d+&amp;gt;` &lt;/P&gt;

&lt;P&gt;-Save the inputs.conf file.&lt;BR /&gt;
-Restart the Splunk instance.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.2/Data/Setadefaulthostforaninput" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.2/Data/Setadefaulthostforaninput&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221671#M43521</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-09-29T11:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Hostname using inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221672#M43522</link>
      <description>&lt;P&gt;Based on your example event, I'm assuming that you're looking to extract the host name from the event data. If that's true, it's done by props/transforms on Indexer/Heavy forwarder and not in inputs.conf on forwarder.&lt;/P&gt;

&lt;P&gt;The Splunk documentation has a page with full details, with example, on what needs to be done to achieve that. Have a look at below link.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Data/Overridedefaulthostassignments"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Data/Overridedefaulthostassignments&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 16:15:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-Hostname-using-inputs-conf/m-p/221672#M43522</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-04T16:15:31Z</dc:date>
    </item>
  </channel>
</rss>

