<?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: Cannot search for value in extracted field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372708#M109610</link>
    <description>&lt;P&gt;Thanks for this, you were right the 51 was a false positive.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2017 09:00:46 GMT</pubDate>
    <dc:creator>jrfrost</dc:creator>
    <dc:date>2017-11-17T09:00:46Z</dc:date>
    <item>
      <title>Cannot search for value in extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372705#M109607</link>
      <description>&lt;P&gt;I have a field extraction that gets the message number from the raw message string&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;.{22}\s&lt;A href="https://community.splunk.com/?d%7B2%7D" target="_blank"&gt;0-9&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The message string is in the format of &lt;/P&gt;

&lt;P&gt;2017-11-15T13:32:53,915 4790018            299939553102122275000175000000000022   6834527000103_0_007500002610100_100850055_00045010000010000_1___________________&lt;/P&gt;

&lt;P&gt;The field is available and has values of 01, 02, 09, 11, 12, 19, 51, 52, 79, 90, 91 etc. but I cannot search for all values.&lt;/P&gt;

&lt;P&gt;If I search for message number 51 I get results&lt;BR /&gt;
&lt;STRONG&gt;index=main  msg_number=51&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If I search for message number 52 no results are returned.&lt;BR /&gt;
&lt;STRONG&gt;index=main  msg_number=52&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If I use the following search  &lt;STRONG&gt;index=main |  eval msg_number=msg_number*1 |search msg_number=52&lt;/STRONG&gt;, I get results&lt;/P&gt;

&lt;P&gt;I have no idea why search for some numbers does not work.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372705#M109607</guid>
      <dc:creator>jrfrost</dc:creator>
      <dc:date>2020-09-29T16:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot search for value in extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372706#M109608</link>
      <description>&lt;P&gt;Hi @jrfrost,&lt;/P&gt;

&lt;P&gt;can you please try this search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| index=main
| rex max_match=0 field=_raw ".{22}\s[0-9](?&amp;lt;msg_number&amp;gt;\d{2})" 
| search msg_number=YOUR_NUMBER
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can Set up your transforms.conf and props.conf files to configure multivalue extraction.&lt;/P&gt;

&lt;P&gt;In transforms.conf, add the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mv-type]
REGEX = .{22}\s[0-9](?&amp;lt;msg_number&amp;gt;\d{2})
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In props.conf for your sourcetype or source, set the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-type = mv-type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 17:11:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372706#M109608</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-16T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot search for value in extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372707#M109609</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/81997"&gt;@jrfrost&lt;/a&gt; My thoughts are that the value you are searching for in "msg_number" is not a separate token in the raw event text but part of a token string in the raw message string from which it is extracted. Events are tokenized based on rules from segmenters.conf, and the value (msg_number) is probably not its own token but just part of a token. Try setting the INDEXED_VALUE in fields.conf on the SH to account for the field-extraction settings.&lt;/P&gt;

&lt;P&gt;drop this exact configuration onto your search heads to fix the issue: &lt;BR /&gt;
$SPLUNK_HOME/etc/system/local/fields.conf &lt;BR /&gt;
[msg_number] &lt;BR /&gt;
&lt;CODE&gt;INDEXED_VALUE=*&amp;lt;VALUE&amp;gt;*&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;restart splunk&lt;/P&gt;

&lt;P&gt;The lispy search will then look something like &lt;CODE&gt;*msg_number*&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;Its likely that the events being returned when you search msg_number=51 is a false positive and contain some other tokens in the raw event text containing 51.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:49:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372707#M109609</guid>
      <dc:creator>rphillips_splk</dc:creator>
      <dc:date>2020-09-29T16:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot search for value in extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372708#M109610</link>
      <description>&lt;P&gt;Thanks for this, you were right the 51 was a false positive.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 09:00:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-search-for-value-in-extracted-field/m-p/372708#M109610</guid>
      <dc:creator>jrfrost</dc:creator>
      <dc:date>2017-11-17T09:00:46Z</dc:date>
    </item>
  </channel>
</rss>

