<?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: extracting domain info from host in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106190#M22358</link>
    <description>&lt;P&gt;ok, but how will i specify to extract from the host field in your props.conf you mention for reporting ? your last props.conf entry&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2011 16:44:24 GMT</pubDate>
    <dc:creator>pmr</dc:creator>
    <dc:date>2011-05-20T16:44:24Z</dc:date>
    <item>
      <title>extracting domain info from host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106187#M22355</link>
      <description>&lt;P&gt;I'm trying to extract domain info from the host field at search time and have the following props and transforms set, but it doesnt seem to work. My example hostname would be art.mozart.apac.com and trying to extract mozart.apac.com.  here's my props and transforms :&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xyz]
REPORT-extract_domain_name = domain_name_extract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[domain_name_extract]&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE_KEY = host
REGEX = (\.\w+\.\w+\.\w+)
FORMAT = domain_name::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is my configuration correct ?  and any reason why this doesnt work ?&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
pmr&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106187#M22355</guid>
      <dc:creator>pmr</dc:creator>
      <dc:date>2020-09-28T09:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: extracting domain info from host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106188#M22356</link>
      <description>&lt;P&gt;You need to escape the dots and add a backslash before your "w" characters. A dot in regex is a special character meaning 'any character'.&lt;/P&gt;

&lt;P&gt;Your regex should probably look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(\.\w+\.\w+\.\w+)$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 May 2011 07:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106188#M22356</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-05-20T07:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: extracting domain info from host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106189#M22357</link>
      <description>&lt;P&gt;If you want to be able to search for this field you have to either make it an indexed field (better performance) &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/Data/Configureindex-timefieldextraction"&gt;http://www.splunk.com/base/Documentation/latest/Data/Configureindex-timefieldextraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xyz]
TRANSFORMS-extract-domain = extract-domain-name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract-domain-name]
SOURCE_KEY = MetaData:Source
REGEX=source::\w+\.([\w\.]+)$
FORMAT = domain_name::$1
WRITE_META = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;fields.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[domain_name]
INDEXED = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;or tell Splunk that the event content (_raw) might not contain the field value:&lt;/P&gt;

&lt;P&gt;fields.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[domain_name]
INDEXED_VALUE = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;If you want to use this field just for reporting, the it should be sufficient to just extract the field:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xyz]
EXTRACT-domain-name = \.(?&amp;lt;domain_name&amp;gt;[\w\.]+) in source
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 May 2011 09:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106189#M22357</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2011-05-20T09:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: extracting domain info from host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106190#M22358</link>
      <description>&lt;P&gt;ok, but how will i specify to extract from the host field in your props.conf you mention for reporting ? your last props.conf entry&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2011 16:44:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106190#M22358</guid>
      <dc:creator>pmr</dc:creator>
      <dc:date>2011-05-20T16:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: extracting domain info from host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106191#M22359</link>
      <description>&lt;P&gt;Ah, I unintentionally wrote the examples with the source field. You just have to append "in host" instead of "in source".&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2011 00:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extracting-domain-info-from-host/m-p/106191#M22359</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2011-05-24T00:10:26Z</dc:date>
    </item>
  </channel>
</rss>

