<?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 multi-level host name in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210911#M41536</link>
    <description>&lt;P&gt;You can setup search time field extraction (on your Search Head) to have both the segments extracted in separate fields. Once you've the field extraction setup, you can use them i the search. &lt;/P&gt;

&lt;P&gt;See these for more info on field extraction&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/107529/best-way-to-create-a-search-time-field-extraction.html" target="_blank"&gt;https://answers.splunk.com/answers/107529/best-way-to-create-a-search-time-field-extraction.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Not sure if this is something which will work for you, but you can use host_regex in inputs.conf, instead of host_segment, to set the host with both the segment values.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:07:55 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2020-09-29T11:07:55Z</dc:date>
    <item>
      <title>Extracting multi-level host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210910#M41535</link>
      <description>&lt;P&gt;I would like to extract both directory and subdirectory information while importing data.&lt;/P&gt;

&lt;P&gt;So basically the directory structure is like this&lt;/P&gt;

&lt;P&gt;monitor:///data/host_name_first_part/host_name_second_part/*.gz&lt;/P&gt;

&lt;P&gt;So in the input.conf I can use either host_segment=2 or host_segment=3&lt;BR /&gt;
but cannot extract both the information, how can I extract both these information.&lt;/P&gt;

&lt;P&gt;I am using unique index name for the data, sourcetype is defined in props.conf&lt;BR /&gt;
how can extract the host names (separately) so that I can also use them in the search command &lt;BR /&gt;
(i.e. I can use host_segment as host in the search command)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210910#M41535</guid>
      <dc:creator>smhsplunk</dc:creator>
      <dc:date>2020-09-29T11:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multi-level host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210911#M41536</link>
      <description>&lt;P&gt;You can setup search time field extraction (on your Search Head) to have both the segments extracted in separate fields. Once you've the field extraction setup, you can use them i the search. &lt;/P&gt;

&lt;P&gt;See these for more info on field extraction&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/107529/best-way-to-create-a-search-time-field-extraction.html" target="_blank"&gt;https://answers.splunk.com/answers/107529/best-way-to-create-a-search-time-field-extraction.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Not sure if this is something which will work for you, but you can use host_regex in inputs.conf, instead of host_segment, to set the host with both the segment values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:07:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210911#M41536</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T11:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multi-level host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210912#M41537</link>
      <description>&lt;P&gt;You could use a rex command like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=source "data\/(?&amp;lt;Field1&amp;gt;\w+)\/(?&amp;lt;Field2&amp;gt;\w+)\/"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 09:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-multi-level-host-name/m-p/210912#M41537</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-09-23T09:59:49Z</dc:date>
    </item>
  </channel>
</rss>

