<?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: Using multiple parameters for regexp host extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497901#M141077</link>
    <description>&lt;P&gt;awesome! works for me with two adaptions:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/data/reports/*/*/*.log]
TRANSFORMS-hostExtract = hostExtract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
    [hostExtract]&lt;BR /&gt;
    SOURCE_KEY = MetaData:Source&lt;BR /&gt;
    REGEX = (\w+)\/(\w+)\/\w+.log$&lt;BR /&gt;
    FORMAT = host::$1_$2&lt;BR /&gt;
    DEST_KEY = MetaData:Host&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:40:39 GMT</pubDate>
    <dc:creator>patrickprodoehl</dc:creator>
    <dc:date>2020-09-30T04:40:39Z</dc:date>
    <item>
      <title>Using multiple parameters for regexp host extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497899#M141075</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;
&lt;P&gt;I am lost in creating a regexp that will ease up my data input creation.&lt;/P&gt;
&lt;P&gt;So I do have a file share being monitored by splunk with the following structure:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/data/reports/ApplicationA/LocationA/very_interesting.log
/data/reports/ApplicationA/LocationB/very_interesting.log
/data/reports/ApplicationB/LocationB/very_interesting.log
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To scale at ease, I would like to define a single data input for ApplicationA which extracts the &lt;CODE&gt;host&lt;/CODE&gt; using 2 parameters of the path. i.e.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;ApplicationA_LocationA
ApplicationA_LocationB
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do you have any idea, how I could transform the &lt;CODE&gt;/&lt;/CODE&gt; between &lt;CODE&gt;ApplicationA&lt;/CODE&gt; and the location subfolders to a &lt;CODE&gt;_&lt;/CODE&gt; and after do the pattern matching to extract the host?&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 18:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497899#M141075</guid>
      <dc:creator>patrickprodoehl</dc:creator>
      <dc:date>2020-06-18T18:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using multiple parameters for regexp host extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497900#M141076</link>
      <description>&lt;P&gt;You need to use transforms.conf. Set &lt;CODE&gt;&amp;lt;spec&amp;gt;&lt;/CODE&gt; to your sourcetype name or source (source::/data/reports/*/*/*.log).&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;spec&amp;gt;]
TRANSFORMS-colorchange
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set_host]
SOURCE_KEY = MetaData:Source
REGEX = (\w+)\/(\w+)\/\w+\.log$
FORMAT = host::$1_$2
DEST_KEY = MetaData:Host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Mar 2020 19:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497900#M141076</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-19T19:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using multiple parameters for regexp host extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497901#M141077</link>
      <description>&lt;P&gt;awesome! works for me with two adaptions:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/data/reports/*/*/*.log]
TRANSFORMS-hostExtract = hostExtract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
    [hostExtract]&lt;BR /&gt;
    SOURCE_KEY = MetaData:Source&lt;BR /&gt;
    REGEX = (\w+)\/(\w+)\/\w+.log$&lt;BR /&gt;
    FORMAT = host::$1_$2&lt;BR /&gt;
    DEST_KEY = MetaData:Host&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-multiple-parameters-for-regexp-host-extraction/m-p/497901#M141077</guid>
      <dc:creator>patrickprodoehl</dc:creator>
      <dc:date>2020-09-30T04:40:39Z</dc:date>
    </item>
  </channel>
</rss>

