<?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: Casing and FQDNs means triple host entries in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338644#M62509</link>
    <description>&lt;P&gt;We feel your pain.  Also, please note, in some types of events we tend to end up with the IP address standing in place of a missing hostname, so you can't grab everything to the left of the period until after you've checked that the entire hostname isn't of the format of an IP. Usually, we end up using upper() and some rexes to make sure we are getting the best guess at the short host.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myhostname "^(?&amp;lt;shost&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[^.\]*)"
| eval shost=upper(coalesce(shost, myhostname, "((MISSING))" ))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above grabs an IP address if it starts out the field (imprecise IP-grabbing rex for demo purposes only) then grabs everything to the left of the first period... which if there is no period, means the whole field.  The only failure in the rex is if the first character is an actual period, in which case the &lt;CODE&gt;eval/coalesce&lt;/CODE&gt; puts the invalid hostname back into place before translating the whole thing to upper case.&lt;/P&gt;

&lt;P&gt;General notes - 1) searches are case-insensitive, but field values are case-sensitive.  2) Field aliasing is your friend. &lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 16:22:29 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-07-31T16:22:29Z</dc:date>
    <item>
      <title>Casing and FQDNs means triple host entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338642#M62507</link>
      <description>&lt;P&gt;I have quite a few hosts that are listed multiple times in Splunk. For an example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;HOST01&lt;/CODE&gt;&lt;BR /&gt;
 &lt;CODE&gt;host01&lt;/CODE&gt;&lt;BR /&gt;
 &lt;CODE&gt;host01.fqdn&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I'm relatively new to Splunk. What are my options for merging those entries?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 15:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338642#M62507</guid>
      <dc:creator>CMSchelin</dc:creator>
      <dc:date>2017-07-31T15:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Casing and FQDNs means triple host entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338643#M62508</link>
      <description>&lt;P&gt;The best thing to do is to have each forwarder report (self-identify) the way that you prefer.  This is controlled in &lt;CODE&gt;server.conf&lt;/CODE&gt; on the forwarder so read the documentation on that.  This effects NEW data but old data will stay jumbled so you can do something like this before you aggregate your data with &lt;CODE&gt;stats&lt;/CODE&gt; or whatever:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=host mode=sed "s/\..*$//" | eval host=lower(host) ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 16:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338643#M62508</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-31T16:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Casing and FQDNs means triple host entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338644#M62509</link>
      <description>&lt;P&gt;We feel your pain.  Also, please note, in some types of events we tend to end up with the IP address standing in place of a missing hostname, so you can't grab everything to the left of the period until after you've checked that the entire hostname isn't of the format of an IP. Usually, we end up using upper() and some rexes to make sure we are getting the best guess at the short host.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myhostname "^(?&amp;lt;shost&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[^.\]*)"
| eval shost=upper(coalesce(shost, myhostname, "((MISSING))" ))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above grabs an IP address if it starts out the field (imprecise IP-grabbing rex for demo purposes only) then grabs everything to the left of the first period... which if there is no period, means the whole field.  The only failure in the rex is if the first character is an actual period, in which case the &lt;CODE&gt;eval/coalesce&lt;/CODE&gt; puts the invalid hostname back into place before translating the whole thing to upper case.&lt;/P&gt;

&lt;P&gt;General notes - 1) searches are case-insensitive, but field values are case-sensitive.  2) Field aliasing is your friend. &lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 16:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Casing-and-FQDNs-means-triple-host-entries/m-p/338644#M62509</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-31T16:22:29Z</dc:date>
    </item>
  </channel>
</rss>

