<?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: Help with custom field extraction during indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521470#M88112</link>
    <description>&lt;P&gt;As you suspected, the transform is incorrect.&amp;nbsp; Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[fieldextraction]
REGEX = "\/usr\/sap\/(?P&amp;lt;SYSTEMDB&amp;gt;.+)\/HDB02\/(?P&amp;lt;vhost&amp;gt;.+)\/trace\/DB_(?P&amp;lt;DBSID&amp;gt;.+)$"
SOURCE_KEY = MetaData:Source
FORMAT = SYSTEMDB::$1 vhost::$2 DBSID::$3&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 25 Sep 2020 14:33:52 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-09-25T14:33:52Z</dc:date>
    <item>
      <title>Help with custom field extraction during indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521460#M88110</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I monitor several VMs and the corresponding database logs with the following stanza:&lt;SPAN&gt;[monitor:///usr/sap/.../HDB02/vhsfh*/trace/DB_*/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The example of the path would be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/usr/sap/NDJ/HDB02/vhsfhndjdb01/trace/DB_VU7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now, I would like to extract &lt;U&gt;&lt;STRONG&gt;during indexing&lt;/STRONG&gt;&lt;/U&gt; from the above path, which is the field "source" &lt;U&gt;&lt;STRONG&gt;additional default fields&lt;/STRONG&gt;&lt;/U&gt; that are always there, which would be:&lt;/P&gt;&lt;P&gt;SYSTEMDB&amp;nbsp; (here: NDJ)&lt;/P&gt;&lt;P&gt;vhost (here:&amp;nbsp;&lt;SPAN&gt;vhsfhndjdb01)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;DBSID (here: VU7)&lt;/P&gt;&lt;P&gt;The corresponding regex expression, if I would do this in the search is:&lt;/P&gt;&lt;P&gt;| rex field=source "\/usr\/sap\/(?P&amp;lt;SYSTEMDB&amp;gt;.+)\/HDB02\/(?P&amp;lt;vhost&amp;gt;.+)\/trace\/DB_(?P&amp;lt;DBSID&amp;gt;.+)$"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how would I do this in the props.conf and transform.conf to make it permanent and always available as the default fields?&lt;/P&gt;&lt;P&gt;I was thinking of the following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[default]&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TRUNCATE&lt;/SPAN&gt;&lt;SPAN&gt;=0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TRANSFORMS-ExtractKeyFields&lt;/SPAN&gt;&lt;SPAN&gt; = fieldextraction&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[fieldextraction]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;REGEX &lt;/SPAN&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;=source &lt;/SPAN&gt;&lt;SPAN&gt;"\/usr\/sap\/(?P&amp;lt;SYSTEMDB&amp;gt;.+)\/HDB02\/(?P&amp;lt;vhost&amp;gt;.+)\/trace\/DB_(?P&amp;lt;DBSID&amp;gt;.+)$"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but I am not sure about the syntax in the transforms.conf.&lt;/DIV&gt;&lt;DIV&gt;Could anyone advice?&lt;/DIV&gt;&lt;DIV&gt;Also, what I am obviously trying to do is to set additional default fields based on other default field which is "source". Is it possible at all? Would the "source" already exist and be available at that point to create additional fields out of it?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Last, do I need additionally put the fields.conf on my SH?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Kind Regards,&lt;/DIV&gt;&lt;DIV&gt;Kamil&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Sep 2020 13:38:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521460#M88110</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2020-09-25T13:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with custom field extraction during indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521470#M88112</link>
      <description>&lt;P&gt;As you suspected, the transform is incorrect.&amp;nbsp; Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[fieldextraction]
REGEX = "\/usr\/sap\/(?P&amp;lt;SYSTEMDB&amp;gt;.+)\/HDB02\/(?P&amp;lt;vhost&amp;gt;.+)\/trace\/DB_(?P&amp;lt;DBSID&amp;gt;.+)$"
SOURCE_KEY = MetaData:Source
FORMAT = SYSTEMDB::$1 vhost::$2 DBSID::$3&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Sep 2020 14:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521470#M88112</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-25T14:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with custom field extraction during indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521493#M88113</link>
      <description>Yes you should put fields.conf to sh so it knows that those fields are indexed. Otherwise it don’t, unless you are using list on your with &amp;lt;field&amp;gt;::&amp;lt;value&amp;gt; notation.&lt;BR /&gt;R. Ismo</description>
      <pubDate>Fri, 25 Sep 2020 15:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521493#M88113</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-09-25T15:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with custom field extraction during indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521990#M88174</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you. It did not work straight away, but after a bit googling and try-errorying the following worked (interestingly, the REGEX itself had to be changed, I would never come up with this myself, it is also not really documented or at least not so easily understandable for me):&lt;/P&gt;&lt;P&gt;[fieldextraction]&lt;BR /&gt;REGEX=^source::\/usr\/sap\/(?P&amp;lt;SYSTEMDB&amp;gt;.+)\/SplunkTest\/(?P&amp;lt;vhost&amp;gt;.+)\/trace\/DB_(?P&amp;lt;DBSID&amp;gt;.+)\/.+$&lt;BR /&gt;SOURCE_KEY=MetaData:Source&lt;BR /&gt;FORMAT=SYSTEMDB::$1 vhost::$2 DBSID::$3&lt;BR /&gt;WRITE_META=true&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Kamil&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-custom-field-extraction-during-indexing/m-p/521990#M88174</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2020-09-29T13:30:53Z</dc:date>
    </item>
  </channel>
</rss>

