<?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: Field Extraction - Hostname with inconsistent in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526199#M148516</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval hostname = "DOMAIN\host1,host2.xxxx.xx.xxxx" 
| makemv delim="," hostname 
| mvexpand hostname 
| rex field=hostname "(DOMAIN\\\){0,1}(?P&amp;lt;host&amp;gt;[^.]+)"&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 23 Oct 2020 09:31:44 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2020-10-23T09:31:44Z</dc:date>
    <item>
      <title>Field Extraction - Hostname with inconsistent</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526074#M148487</link>
      <description>&lt;P&gt;I'm trying to do a field extraction for a hostname field that has some inconsistency with the format.&lt;BR /&gt;&lt;BR /&gt;There are two types of formats for the hostname field and they can be in upper or lower, i need them in lower.&lt;BR /&gt;&lt;BR /&gt;DOMAIN\hostname or hostname.xxxx.xx.xxx&lt;BR /&gt;&lt;BR /&gt;Previously, I was replacing what I didn't want in that field , lowering that eval in order to join to a lookup table. What I'm trying to do now is a field extraction from that hostname field check for both formats and then removes DOMAIN\ or the .xxxxx.xx.xxx fqdn format from the end.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My REX commands that I'm using:&lt;/P&gt;&lt;P&gt;| rex field=hostname "DOMAIN\\\(?P&amp;lt;ComputerName&amp;gt;.*)"&lt;BR /&gt;&lt;BR /&gt;|rex field=hostname "^(?&amp;lt;ComputerName&amp;gt;[^\.]+)"&lt;BR /&gt;&lt;BR /&gt;Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 17:32:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526074#M148487</guid>
      <dc:creator>jpsheridan</dc:creator>
      <dc:date>2020-10-22T17:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Hostname with inconsistent</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526091#M148494</link>
      <description>&lt;P&gt;What results are you getting from your current search?&amp;nbsp; What results do you want?&lt;/P&gt;&lt;P&gt;It would help to see some sample data.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 19:16:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526091#M148494</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-10-22T19:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Hostname with inconsistent</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526102#M148497</link>
      <description>&lt;P&gt;I will get a mix of hostnames in these two formats:&lt;BR /&gt;&lt;BR /&gt;DOMAIN\hostname&lt;/P&gt;&lt;P&gt;hostname.xxxxx.xx.xxxx&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;DOMAIN and the x's are just from their fqdn. Some are upper and some are lower and the source is coming from a 3rd party system. I just want to pull the hostname in lower case for a field extraction.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 20:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526102#M148497</guid>
      <dc:creator>jpsheridan</dc:creator>
      <dc:date>2020-10-22T20:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Hostname with inconsistent</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526196#M148514</link>
      <description>&lt;P&gt;What is wrong with the two rex you already have (apart from perhaps too many backslashes?)?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 09:01:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526196#M148514</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-23T09:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Hostname with inconsistent</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526199#M148516</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval hostname = "DOMAIN\host1,host2.xxxx.xx.xxxx" 
| makemv delim="," hostname 
| mvexpand hostname 
| rex field=hostname "(DOMAIN\\\){0,1}(?P&amp;lt;host&amp;gt;[^.]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 09:31:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Hostname-with-inconsistent/m-p/526199#M148516</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-10-23T09:31:44Z</dc:date>
    </item>
  </channel>
</rss>

