<?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: How can we normalize our syslog host names? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457224#M78993</link>
    <description>&lt;P&gt;Gorgeous @jkat54 and @FrankVl - as @jkat54 assumed, I do use the syslog daemon to receive this data and write it to disk, for Splunk to read it from file.&lt;/P&gt;

&lt;P&gt;I'll try the &lt;CODE&gt;uppercase&lt;/CODE&gt; function....&lt;/P&gt;

&lt;P&gt;Are you also telling me that we can't make conversions using the &lt;CODE&gt;REGEX&lt;/CODE&gt; command?&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2019 13:48:41 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2019-07-08T13:48:41Z</dc:date>
    <item>
      <title>How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457220#M78989</link>
      <description>&lt;P&gt;Our syslog data looks like - &lt;CODE&gt;# 2019 Jun 25 17:54:30 xxx-yyy-zzz-8 daemon info DataCollector&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;In &lt;CODE&gt;transforms.conf&lt;/CODE&gt; we have -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host_override]
REGEX = ^\d{4}\s+\S+\s+\d+\s+\d{2}\:\d{2}\:\d{2}\s+(\S+)\s+
DEST_KEY = MetaData:Host
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, our device host names come as - &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;xxx-yyy-zzz-8&lt;/CODE&gt; or&lt;BR /&gt;
&lt;CODE&gt;xxx-yyy-zzz-8.domain.com&lt;/CODE&gt; or&lt;BR /&gt;
&lt;CODE&gt;XXX-YYY-ZZZ-8&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So, we would like to normalize the device name to be of upper case and without the domain part, meaning &lt;CODE&gt;XXX-YYY-ZZZ-8&lt;/CODE&gt; is the preferred format. &lt;/P&gt;

&lt;P&gt;What should I do?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2019 01:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457220#M78989</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-07T01:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457221#M78990</link>
      <description>&lt;P&gt;Hello friend,&lt;/P&gt;

&lt;P&gt;Check out this syslog-ng macro:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;uppercase
Syntax:
$(uppercase "&amp;lt;macro&amp;gt;")
Description: Returns the uppercase version of the specified string or macro. For example, the following example uses the uppercase version of the hostname in a directory name:
destination d_file {
    file ("/var/log/${MONTH}/${DAY}/$(uppercase "${HOST}")/messages");
};
Available in syslog-ng OSE 3.5 and later.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Jul 2019 11:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457221#M78990</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-07T11:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457222#M78991</link>
      <description>&lt;P&gt;Same thing is available in rsyslog:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.rsyslog.com/doc/v8-stable/configuration/property_replacer.html"&gt;https://www.rsyslog.com/doc/v8-stable/configuration/property_replacer.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2019 11:16:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457222#M78991</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-07T11:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457223#M78992</link>
      <description>&lt;P&gt;That is a neat solution, but does assume @ddrillic is using a syslog daemon to receive this data and write it to disk, for Splunk to read it from file. Then this could help get the hostname in uppercase. You'd still need some more work to get rid of the domain part. But this would anyway need a change to his props/transforms since right now he is taking the host  from inside the event, which will not change with this syslog uppercase 'trick'.&lt;/P&gt;

&lt;P&gt;PS: @ddrillic field values are not case sensitive in Splunk searches, so I'm curious why you want this all in uppercase (the domain stripping I can understand)?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 06:04:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457223#M78992</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-07-08T06:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457224#M78993</link>
      <description>&lt;P&gt;Gorgeous @jkat54 and @FrankVl - as @jkat54 assumed, I do use the syslog daemon to receive this data and write it to disk, for Splunk to read it from file.&lt;/P&gt;

&lt;P&gt;I'll try the &lt;CODE&gt;uppercase&lt;/CODE&gt; function....&lt;/P&gt;

&lt;P&gt;Are you also telling me that we can't make conversions using the &lt;CODE&gt;REGEX&lt;/CODE&gt; command?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:48:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457224#M78993</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-08T13:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457225#M78994</link>
      <description>&lt;P&gt;With what he is suggesting, you're only affecting the foldername to which the events are written, not the content of the events themselves. So you need to change your approach for extracting the host name. Not take it from the event, but use &lt;CODE&gt;host_regex&lt;/CODE&gt; in props.conf to extract it from the source path.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:01:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457225#M78994</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-07-08T14:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457226#M78995</link>
      <description>&lt;P&gt;The following worked -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;destination d_xxxxx { file("/data/xxxxx/$(uppercase ${HOST})_syslog.log" create_dirs(yes) owner(id) group(zzzzz) template("${FULLDATE} $(uppercase ${HOST}) ${FACILITY} ${PRIORITY} ${PROGRAM} ${MSG} \n")); };
log { source(s_udp514); filter(f_xxxxx); destination(d_xxxxx); flags(final); };
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For the file name as well as within the template for the host name - no double quotes ; -) &lt;/P&gt;

&lt;P&gt;Thank you @jkat54 !!!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 17:35:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457226#M78995</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-08T17:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457227#M78996</link>
      <description>&lt;P&gt;I still needs some help to remove the domain name in the &lt;CODE&gt;REGEX&lt;/CODE&gt; part ; -) &lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 17:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457227#M78996</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-08T17:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457228#M78997</link>
      <description>&lt;P&gt;Will it always be .domain.com?&lt;/P&gt;

&lt;P&gt;If so you should be able to use REGEX In syslog or Splunk.  I assume you want to do it in syslog?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 00:15:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457228#M78997</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-09T00:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457229#M78998</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;rewrite r_rewrite_subst{
    subst('.domain.com', '', value("MESSAGE"), flags("global"));
};
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 00:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457229#M78998</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-09T00:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457230#M78999</link>
      <description>&lt;P&gt;&lt;A href="https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/59#TOPIC-956610"&gt;https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/59#TOPIC-956610&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 00:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457230#M78999</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-09T00:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457231#M79000</link>
      <description>&lt;P&gt;*Will it always be .domain.com?&lt;BR /&gt;
Yup&lt;/P&gt;

&lt;P&gt;*If so you should be able to use REGEX In syslog or Splunk. I assume you want to do it in syslog?&lt;/P&gt;

&lt;P&gt;It's a good question @jkat54 - I guess that syslog is the right place. &lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 00:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457231#M79000</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-09T00:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457232#M79001</link>
      <description>&lt;P&gt;Just write your hostname capturing regex to match up until the first &lt;CODE&gt;.&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;So taking your original config, change it to for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host_override]
 REGEX = ^\d{4}\s+\S+\s+\d+\s+\d{2}\:\d{2}\:\d{2}\s+([^.]+)\s+
 DEST_KEY = MetaData:Host
 FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 06:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457232#M79001</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-07-09T06:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457233#M79002</link>
      <description>&lt;P&gt;Thanks for sharing your final solution!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 11:57:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457233#M79002</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-09T11:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457234#M79003</link>
      <description>&lt;P&gt;Sure thing @jkat54 - lots of fun with this thread ; -) &lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 14:14:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457234#M79003</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-09T14:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457235#M79004</link>
      <description>&lt;P&gt;Gorgeous @FrankVl - much appreciated. &lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 14:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457235#M79004</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-09T14:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457236#M79005</link>
      <description>&lt;P&gt;The following seems to work for me @FrankVl as the period doesn't always exist - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^\d{4}\s+\S+\s+\d+\s+\d{2}\:\d{2}\:\d{2}\s+([a-zA-Z\-0-9]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 14:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457236#M79005</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-09T14:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457237#M79006</link>
      <description>&lt;P&gt;Yeah, something like that is better. Or &lt;CODE&gt;[-\w]+&lt;/CODE&gt; which is more or less the same, with the addition of &lt;CODE&gt;_&lt;/CODE&gt; and should cover anything you can find in a hostname.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 14:39:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457237#M79006</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-07-09T14:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can we normalize our syslog host names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457238#M79007</link>
      <description>&lt;P&gt;Gorgeous ; -) &lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 14:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-normalize-our-syslog-host-names/m-p/457238#M79007</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-09T14:42:31Z</dc:date>
    </item>
  </channel>
</rss>

