<?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 How can I control or force the hostname to be a specific value via inputs.conf? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-control-or-force-the-hostname-to-be-a-specific-value/m-p/636614#M108873</link>
    <description>&lt;P&gt;How can I control or force the hostname to be a specific value via inputs.conf?&lt;BR /&gt;&lt;BR /&gt;Inputs.conf stanza&lt;/P&gt;&lt;P&gt;[monitor:///var/log/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;host = hostname1,hostname2,hostname3,hostname4&lt;/P&gt;&lt;P&gt;[monitor:///var/adm/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;host = hostname1,hostname2,hostname3,hostname4&lt;/P&gt;&lt;P&gt;[monitor:///etc/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;host = hostname1,hostname2,hostname3,hostname4&lt;BR /&gt;&lt;BR /&gt;I have tried multiple solution&lt;/P&gt;&lt;P&gt;Case 1--&amp;gt; added host_regex=&amp;lt;regular expression&amp;gt;&amp;nbsp; this did not work.&lt;BR /&gt;Case 2 --&amp;gt; added host= hostname1,hostname2,hostname3,hostname4 ---&amp;gt; this worked for some log file path like .var/log/message host = hostname1 and for some log file path like /var/log/dnf.log I am getting hostname=hostname1,hostname2,hostname3,hostname4&lt;BR /&gt;Case 3 --&amp;gt; I tried utilizing the feature where inputs.conf looks like below. But I can not implement this as a solution as the app will be pushed from DS to all UF respectively hence hardcoding using default setting can not be done in my case.&lt;BR /&gt;inputs.conf&lt;/P&gt;&lt;PRE&gt;[default]
host = &amp;lt;hostname1&amp;gt;&lt;/PRE&gt;&lt;P&gt;[monitor:///var/log/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[monitor:///var/adm/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[monitor:///etc/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 02:54:34 GMT</pubDate>
    <dc:creator>AK_Splunk</dc:creator>
    <dc:date>2023-03-30T02:54:34Z</dc:date>
    <item>
      <title>How can I control or force the hostname to be a specific value via inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-control-or-force-the-hostname-to-be-a-specific-value/m-p/636614#M108873</link>
      <description>&lt;P&gt;How can I control or force the hostname to be a specific value via inputs.conf?&lt;BR /&gt;&lt;BR /&gt;Inputs.conf stanza&lt;/P&gt;&lt;P&gt;[monitor:///var/log/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;host = hostname1,hostname2,hostname3,hostname4&lt;/P&gt;&lt;P&gt;[monitor:///var/adm/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;host = hostname1,hostname2,hostname3,hostname4&lt;/P&gt;&lt;P&gt;[monitor:///etc/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;host = hostname1,hostname2,hostname3,hostname4&lt;BR /&gt;&lt;BR /&gt;I have tried multiple solution&lt;/P&gt;&lt;P&gt;Case 1--&amp;gt; added host_regex=&amp;lt;regular expression&amp;gt;&amp;nbsp; this did not work.&lt;BR /&gt;Case 2 --&amp;gt; added host= hostname1,hostname2,hostname3,hostname4 ---&amp;gt; this worked for some log file path like .var/log/message host = hostname1 and for some log file path like /var/log/dnf.log I am getting hostname=hostname1,hostname2,hostname3,hostname4&lt;BR /&gt;Case 3 --&amp;gt; I tried utilizing the feature where inputs.conf looks like below. But I can not implement this as a solution as the app will be pushed from DS to all UF respectively hence hardcoding using default setting can not be done in my case.&lt;BR /&gt;inputs.conf&lt;/P&gt;&lt;PRE&gt;[default]
host = &amp;lt;hostname1&amp;gt;&lt;/PRE&gt;&lt;P&gt;[monitor:///var/log/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[monitor:///var/adm/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[monitor:///etc/*]&lt;BR /&gt;disabled = 0&lt;BR /&gt;index = test_data&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 02:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-control-or-force-the-hostname-to-be-a-specific-value/m-p/636614#M108873</guid>
      <dc:creator>AK_Splunk</dc:creator>
      <dc:date>2023-03-30T02:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I control or force the hostname to be a specific value via inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-control-or-force-the-hostname-to-be-a-specific-value/m-p/636641#M108879</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243360"&gt;@AK_Splunk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: where do you whould take the hostname value to associate to an event, from a path segment or from the UF hostname, or a part of the log itself, or where else?&lt;/P&gt;&lt;P&gt;Anyway, using the "host" option in inputs.conf, you can assign one fixed value to the host field.&lt;/P&gt;&lt;P&gt;You can also extract the host field from the path of the file or from a part of the name.&lt;/P&gt;&lt;P&gt;outside inputs.conf (using props.conf and transforms.conf on Heavy Forwarders or Indexers), you can also extract the host from the content of the event overriding the default value.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 07:00:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-control-or-force-the-hostname-to-be-a-specific-value/m-p/636641#M108879</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-30T07:00:44Z</dc:date>
    </item>
  </channel>
</rss>

