<?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 Field Extraction from Source Field in props.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-Source-Field-in-props-conf/m-p/441179#M76905</link>
    <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I am going bananas trying to figure out the error in my props.conf. All of my logs are collected using Splunk Enterprise and forwarded to a centralized server that I do not have CLI access to. I do all of my main configuration from the source host command line and forward the data to the centralized server. I need to extract a field called "microservice" from my source path. I have tested my regular expression in search with the following statement and it works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=myhostname sourcetype=log4j | rex field=source "^\/opt\/apps\/myapp\/microServices\/(?&amp;lt;microservice&amp;gt;\w+)\/.*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example path:&lt;BR /&gt;
/opt/apps/myapp/microServices/neededDirectoryName/Logs/mylog_log.log&lt;/P&gt;

&lt;P&gt;There are many directories that I am collecting logs from that are the same sourcetype: log4j. I am also only indexing error logs from this sourcetype as well, that is what the TRANSFORMS is for. I'll include my transform.conf for reference. I have other regular expressions extracting fields from the log events on Splunk web (on the centralized server).&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4j]
EXTRACT-mspls = ^\/opt\/apps\/myapp\/microServices\/(?&amp;lt;microservice&amp;gt;\w+)\/.* in source
TRANSFORMS-set = nullqueue, errorlogs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[nullqueue]
REGEX= .
DEST_KEY = queue
FORMAT = nullQueue

[errorlogs]
REGEX = ^(\[ERROR\]|\[WARN\]|\[MANDATORY\])
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you!!&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 19:25:57 GMT</pubDate>
    <dc:creator>nwaller</dc:creator>
    <dc:date>2018-08-31T19:25:57Z</dc:date>
    <item>
      <title>Field Extraction from Source Field in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-Source-Field-in-props-conf/m-p/441179#M76905</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I am going bananas trying to figure out the error in my props.conf. All of my logs are collected using Splunk Enterprise and forwarded to a centralized server that I do not have CLI access to. I do all of my main configuration from the source host command line and forward the data to the centralized server. I need to extract a field called "microservice" from my source path. I have tested my regular expression in search with the following statement and it works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=myhostname sourcetype=log4j | rex field=source "^\/opt\/apps\/myapp\/microServices\/(?&amp;lt;microservice&amp;gt;\w+)\/.*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example path:&lt;BR /&gt;
/opt/apps/myapp/microServices/neededDirectoryName/Logs/mylog_log.log&lt;/P&gt;

&lt;P&gt;There are many directories that I am collecting logs from that are the same sourcetype: log4j. I am also only indexing error logs from this sourcetype as well, that is what the TRANSFORMS is for. I'll include my transform.conf for reference. I have other regular expressions extracting fields from the log events on Splunk web (on the centralized server).&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4j]
EXTRACT-mspls = ^\/opt\/apps\/myapp\/microServices\/(?&amp;lt;microservice&amp;gt;\w+)\/.* in source
TRANSFORMS-set = nullqueue, errorlogs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[nullqueue]
REGEX= .
DEST_KEY = queue
FORMAT = nullQueue

[errorlogs]
REGEX = ^(\[ERROR\]|\[WARN\]|\[MANDATORY\])
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 19:25:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-Source-Field-in-props-conf/m-p/441179#M76905</guid>
      <dc:creator>nwaller</dc:creator>
      <dc:date>2018-08-31T19:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Source Field in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-Source-Field-in-props-conf/m-p/441180#M76906</link>
      <description>&lt;P&gt;What problem are you having?  Is the field not getting extracted?  The event not showing up?  Something else?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 20:43:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-Source-Field-in-props-conf/m-p/441180#M76906</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-08-31T20:43:56Z</dc:date>
    </item>
  </channel>
</rss>

