<?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: Field Extraction matching not working but works only with wildcard in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376944#M110611</link>
    <description>&lt;P&gt;Is this only happening with the message_id field? Does the number of digits for this value vary between events or logs? If not, you could try to specify &lt;STRONG&gt;\d{4}&lt;/STRONG&gt; or &lt;STRONG&gt;\d{1,6}&lt;/STRONG&gt; and see if it makes a difference. Just an idea.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2019 13:35:48 GMT</pubDate>
    <dc:creator>oscar84x</dc:creator>
    <dc:date>2019-07-11T13:35:48Z</dc:date>
    <item>
      <title>Field Extraction matching not working but works only with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376943#M110610</link>
      <description>&lt;P&gt;Strange problem but couldn't find the root cause. Just checking if anyone of you have come across similar?&lt;/P&gt;

&lt;P&gt;Sample data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-07-11T12:26:40+00:00 ABC-94 someproduct: ^1001/0^20190711122640087^MYDB^USER260^Sign-on^MYUSER1
2019-07-11T12:26:41+00:00 ABC-94 someproduct: ^1002/0^20190711122641087^MYDB^USER260^Sign-off^MYUSER2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've configured props.conf as &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-myDB_fields = \s+\^(?&amp;lt;message_id&amp;gt;\d+)\/(?&amp;lt;subtype&amp;gt;0)\^(?&amp;lt;datetime&amp;gt;[^\^]*)\^(?&amp;lt;userid&amp;gt;[^\^]*)\^(?&amp;lt;runid&amp;gt;[^\^]*)\^(?&amp;lt;description&amp;gt;[^\^]*)\^(?&amp;lt;user_id&amp;gt;.*)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried it using props.conf &amp;amp; transforms.conf, still there is issue&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#props.conf
REPORT-mydb_extract = mydb_extract_common, mydb_extract_specific  

#transforms.conf
[mydb_extract_common]
REGEX=^(?&amp;lt;mydb_syslog_metadata&amp;gt;[^\^]+)\s+\^(?&amp;lt;mydb_specific_fields&amp;gt;.+)$

[mydb_extract_specific ]
SOURCE_KEY=mydb_specific_fields
DELIMS = "^"
FIELDS = "message_type","datetime","userid","runid","description","user_id"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The extractions works perfectly in regex101 and Splunk GUI. Fields are shown perfectly&lt;BR /&gt;
BUT...&lt;BR /&gt;
When i query in SPL&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=mycustom message_id=1001   =&amp;gt; This fails. Fails on ALL fields not just message_id
index=* sourcetype=mycustom message_id=*1001*   =&amp;gt; This is success when you put wildcard wrappers on it.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I do a &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=mycustom | stats count by message_id  =&amp;gt; This works perfectly and yields 1001 and 1002 etc.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure why the changes are done in props.conf it inserts some character between the fields? Is there something magical for &lt;CODE&gt;^&lt;/CODE&gt; field extraction?&lt;/P&gt;

&lt;P&gt;Also I've run a length of the string. This is same as the string. So not related to any hidden characters or spaces.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval length_message_id=len(message_id)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I do via makeresults, there is no issue. Something related to props/transforms?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 12:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376943#M110610</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-07-11T12:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction matching not working but works only with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376944#M110611</link>
      <description>&lt;P&gt;Is this only happening with the message_id field? Does the number of digits for this value vary between events or logs? If not, you could try to specify &lt;STRONG&gt;\d{4}&lt;/STRONG&gt; or &lt;STRONG&gt;\d{1,6}&lt;/STRONG&gt; and see if it makes a difference. Just an idea.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 13:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376944#M110611</guid>
      <dc:creator>oscar84x</dc:creator>
      <dc:date>2019-07-11T13:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction matching not working but works only with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376945#M110612</link>
      <description>&lt;P&gt;This happens on all fields unfortunately &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 13:52:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376945#M110612</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-07-11T13:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction matching not working but works only with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376946#M110613</link>
      <description>&lt;P&gt;I've been through that. Change your special chars to unicode like &lt;CODE&gt;\x5C&lt;/CODE&gt; for &lt;CODE&gt;\\&lt;/CODE&gt; in the props extract and it may solve your problem there. The escaping works different between rex on SPL and a props inline extract&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.utf8-chartable.de/unicode-utf8-table.pl?unicodeinhtml=hex"&gt;https://www.utf8-chartable.de/unicode-utf8-table.pl?unicodeinhtml=hex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 14:08:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376946#M110613</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-07-11T14:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction matching not working but works only with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376947#M110614</link>
      <description>&lt;P&gt;You have to tell the Search Head that these fields are not indexed values (they do not fall between to major/minor breakers) by adding this to &lt;CODE&gt;fields.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[message_id]
INDEXED_VALUE = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See details here:&lt;BR /&gt;
&lt;A href="https://www.splunk.com/blog/2011/10/07/cannot-search-based-on-an-extracted-field.html"&gt;https://www.splunk.com/blog/2011/10/07/cannot-search-based-on-an-extracted-field.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 14:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376947#M110614</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-11T14:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction matching not working but works only with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376948#M110615</link>
      <description>&lt;P&gt;Thanks again Gregg.  &lt;/P&gt;

&lt;P&gt;Just to add some flesh into above comment, it is all about Major and Minor breakers. The list of breakers are available in &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Segmentersconf"&gt;segmenters.conf&lt;/A&gt;  and &lt;CODE&gt;^&lt;/CODE&gt; is &lt;STRONG&gt;NOT&lt;/STRONG&gt; part of it. This means, any fields extracted needs to have  &lt;CODE&gt;INDEXED_VALUE=false&lt;/CODE&gt; if it has to be specified in search.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 08:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-matching-not-working-but-works-only-with/m-p/376948#M110615</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-07-12T08:58:21Z</dc:date>
    </item>
  </channel>
</rss>

