<?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: edit Linux agents to always return 'host' as FQDN? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486103#M193660</link>
    <description>&lt;P&gt;No, you just need to put below config in your Indexer, I will suggest you to test first in your test environment and then move to production.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
TRANSFORMS = 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Mar 2020 16:52:09 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2020-03-06T16:52:09Z</dc:date>
    <item>
      <title>edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486091#M193648</link>
      <description>&lt;P&gt;This seems to be a common question and I've read several previous discussions. The issue seems to be that the default Linux UF config 'knows' the FQDN and returns that for log-flies which do not have a 'host' value, but then some of the most important files, e.g. /var/log/messages, do include a host and so the UF 'defers' to that value, even if it's not FQDN.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;The simplest solution has been to update your Linux servers' rsyslog config to record the FQDN to all logs. But I am trying to avoid walking my environment to make that change. &lt;/P&gt;

&lt;P&gt;Instead I am looking for a specific example of the required transform.conf, which I could push to all UFs (via a deploy-app) so that they 're-substitute' the FQDN for the short 'host' value. Can someone please show me how? Thank you!&lt;/P&gt;

&lt;P&gt;P.S. I am also trying to avoid doing this at the indexer, both because it is unclear if the indexer has access to the FQDN and also because this is a shared environment and I do not have permission to edit this system-wide; I am only trying to fix my dept's servers.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 22:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486091#M193648</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-03-04T22:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486092#M193649</link>
      <description>&lt;P&gt;Hi @ttovarzoll,&lt;/P&gt;

&lt;P&gt;Check this page: &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.2001/Data/Overridedefaulthostassignments"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.0.2001/Data/Overridedefaulthostassignments&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Steps given in page works for both Splunk enterprise and cloud. You can create props.conf and transforms.conf in your forwarder add-on and deploy it on UFs.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 23:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486092#M193649</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-04T23:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486093#M193650</link>
      <description>&lt;P&gt;Refer to this wiki article first:&lt;BR /&gt;
&lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You will see that transforms comes in much later on in the pipeline. It's not a config that will end up on the UF to append the FQDN at the UF, it happens at the Indexer tier.&lt;/P&gt;

&lt;P&gt;You can create a lookup table to fix this issue, though this would be ongoing maintenance:&lt;BR /&gt;
1) Create a search to output all the host in a table&lt;BR /&gt;
2) Export the host list and create a new column, which has the FQDN entry&lt;BR /&gt;
3) Import the lookup file onto the SH to an existing / new app&lt;BR /&gt;
4) Run the lookup search as part of the spl and it will return thee FQDN value&lt;/P&gt;

&lt;P&gt;Alternatively (preferred), you can do it to OS way, more work initially though this will help create a consistent process&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/45899/how-can-i-use-the-fully-qualified-domain-name-fqdn-as-the-host-value-for-var-log-messages.html"&gt;https://answers.splunk.com/answers/45899/how-can-i-use-the-fully-qualified-domain-name-fqdn-as-the-host-value-for-var-log-messages.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 23:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486093#M193650</guid>
      <dc:creator>anmolpatel</dc:creator>
      <dc:date>2020-03-04T23:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486094#M193651</link>
      <description>&lt;P&gt;Thanks, that gets me closer! The only example in that doc, however, is for using regex to extract the 'host' field from the particular log-file. I'm trying to use the FQDN 'host' stored (I believe) in the local 'server.conf', i.e., the expected solution will not need to mention any particular log-file. So how do I specify that?&lt;/P&gt;

&lt;P&gt;Also, we are running the Splunk Add-on for Unix And Linux, so we are pushing that 'Splunk_TA_nix' deploy-app, which includes the following stanza in 'inputs.conf'&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[monitor:///var/log] &lt;BR /&gt;
index = os&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Is that the stanza I need to reference in my new 'props.conf'? Also, can I create that custom props.conf in the same deploy-app where I specify my own custom inputs.conf?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486094#M193651</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-09-30T04:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486095#M193652</link>
      <description>&lt;P&gt;Thank you for the link to that Wiki article.&lt;/P&gt;

&lt;P&gt;Lookup table seems unnecessary since the UF already knows the FQDN, I just need to retrieve it.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 23:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486095#M193652</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-03-04T23:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486096#M193653</link>
      <description>&lt;P&gt;OK, then you just need add host = $decideOnStartup to monitor stanza in inputs.conf in Splunk_TA_nix app and push. This sets the host field to the hostname of executing machine on each splunkd startup. No props.conf and transforms.conf is required.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log]
index = os
host = $decideOnStartup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:29:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486096#M193653</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-09-30T04:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486097#M193654</link>
      <description>&lt;P&gt;Thank you for the $DecideOnStartup suggestion! Unfortunately, I couldn't make it work, even after a full restart of my test server.&lt;/P&gt;

&lt;P&gt;Actually, I even tried hard-coding the FQDN and that still failed, i.e., the references for 'syslog' in the transforms.conf of the Splunk_TA_nix seems to take precedence (over the inputs.conf)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486097#M193654</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-09-30T04:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486098#M193655</link>
      <description>&lt;P&gt;It's case sensitive you need to set $decideOnStartup not $DecideOnStartup. And also check if host is set in $SPLUNK_UFHOME/etc/system/local/inputs.conf on UFs. Remove the host setting if it exists in system local.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 18:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486098#M193655</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-05T18:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486099#M193656</link>
      <description>&lt;P&gt;yes, I had copy-and-pasted your example so the case-sensitive part was correct (assuming your example was correct). My initial reply I wrote it by hand, then corrected it.&lt;/P&gt;

&lt;P&gt;My default inputs.conf has the FQDN! This is what is being overridden by the Splunk_TA_nix transforms for syslog-type logs:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;cat /opt/splunkforwarder/etc/system/local/inputs.conf&lt;/P&gt;

&lt;P&gt;[default]&lt;BR /&gt;
host = server123.mycompany.com&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486099#M193656</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-09-30T04:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486100#M193657</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In splunk installation there is default props configuration for &lt;CODE&gt;/var/log/messages&lt;/CODE&gt; which assigns sourcetype &lt;CODE&gt;syslog&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::.../messages(.\d+)?]
sourcetype = syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you look at &lt;CODE&gt;syslog&lt;/CODE&gt; sourcetype configuration on your indexer you will able to see below config&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
pulldown_type = true 
maxDist = 3
TIME_FORMAT = %b %d %H:%M:%S
MAX_TIMESTAMP_LOOKAHEAD = 32
TRANSFORMS = syslog-host
REPORT-syslog = syslog-extractions
SHOULD_LINEMERGE = False
category = Operating System
description = Output produced by many syslog daemons, as described in RFC3164 by the IETF
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In above configuration &lt;CODE&gt;TRANSFORMS = syslog-host&lt;/CODE&gt; is using below REGX which extracts hostname from actual rawdata&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog-host]
DEST_KEY = MetaData:Host
REGEX = :\d\d\s+(?:\d+\s+|(?:user|daemon|local.?)\.\w+\s+)*\[?(\w[\w\.\-]{2,})\]?\s
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you are only using &lt;CODE&gt;syslog&lt;/CODE&gt; sourcetype in your environment for &lt;CODE&gt;/var/log/messages&lt;/CODE&gt; and not for any other sources and you want to use Linux FQDN (same as given in inputs.conf on UF) for &lt;CODE&gt;syslog&lt;/CODE&gt; sourcetype then you can try below configuration to override default configuration on Indexer or Heavy Forwarder whichever come first from UF.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
TRANSFORMS = 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Mar 2020 21:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486100#M193657</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2020-03-05T21:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486101#M193658</link>
      <description>&lt;P&gt;Thank you for the clear and detailed explanation! It sounds like -- regardless of what I try to do on the agent side -- the Indexer is going to 'transform' the default host value to whatever the regex finds in the log-file. &lt;/P&gt;

&lt;P&gt;So I need to either: &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;edit the configuration of the Indexer (which will affect all depts, something I had hoped to avoid), or&lt;/LI&gt;
&lt;LI&gt;edit all my agents to record the FQDN to all syslog-type logs&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;In your example of editing the Indexer 'props.conf' are you saying I need to delete all entries for [syslog] or only the 'TRANSFORMS=' setting?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 23:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486101#M193658</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-03-05T23:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486102#M193659</link>
      <description>&lt;P&gt;Use btool to see host setting set for syslog source and from which config file. And remove host setting from that config file for the sourcetype.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_UFHOME/bin/splunk cmd btool inputs list --debug
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 08:10:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486102#M193659</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-06T08:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486103#M193660</link>
      <description>&lt;P&gt;No, you just need to put below config in your Indexer, I will suggest you to test first in your test environment and then move to production.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
TRANSFORMS = 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 16:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486103#M193660</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2020-03-06T16:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: edit Linux agents to always return 'host' as FQDN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486104#M193661</link>
      <description>&lt;P&gt;&lt;STRONG&gt;SOLUTION&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I decided to 'bite the bullet' and update the local rsyslogd on all our servers. The reason (which I found in another discussion) is that syslog is designed to also act as a 'collector' from other servers, i.e., you cannot assume that all the message in /var/log/messages are local.&lt;/P&gt;

&lt;P&gt;All of these suggestions -- and in fact the premise of my original request -- try to ignore the contents of the syslog files in favor of using the FQDN of the reporting-server. But since that initial assumption is invalid, the only safe method is to write the FQDN to the logs, i.e., implement FQDN at the source.&lt;/P&gt;

&lt;P&gt;Thank you to everyone who contributed suggestions for fixing this in a centralized manner!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 20:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/edit-Linux-agents-to-always-return-host-as-FQDN/m-p/486104#M193661</guid>
      <dc:creator>ttovarzoll</dc:creator>
      <dc:date>2020-03-26T20:48:57Z</dc:date>
    </item>
  </channel>
</rss>

