<?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: Why am i unable to search a value in an extracted field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394948#M114720</link>
    <description>&lt;P&gt;Did some parts of the regex go missing? It looks like it. &lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 21:57:42 GMT</pubDate>
    <dc:creator>xpac</dc:creator>
    <dc:date>2018-05-09T21:57:42Z</dc:date>
    <item>
      <title>Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394947#M114719</link>
      <description>&lt;P&gt;I have a log file with three lines.&lt;/P&gt;

&lt;P&gt;09-05-2018 10:12:15,123 ABC12I_AAA&lt;BR /&gt;
09-05-2018 10:12:15,123 ABC12I_BBB&lt;BR /&gt;
09-05-2018 10:12:15,123 ABC12O_CCC&lt;/P&gt;

&lt;P&gt;In transforms.conf my REGEX is: &lt;BR /&gt;
(?\d+-\d+-\d+\s+\d+:\d+:\d+,\d+)\s+(?\w{5})(?\w{1})_&lt;/P&gt;

&lt;P&gt;If I make a simple search on the sourcetype I get the three events of the log. If I look to the fields, I see the field "Sp" with the value "ABC12" for each event &lt;/P&gt;

&lt;P&gt;If I make a search with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sp=ABC12
I get no events
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I make a search with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sp=ABC12*
I get 3 events
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I make a search with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sp=*ABC12
I get 3 events
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am not able to understand why the search Sp=ABC12 gives no events.&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
Can somebody help me?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394947#M114719</guid>
      <dc:creator>gtonti</dc:creator>
      <dc:date>2020-09-29T19:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394948#M114720</link>
      <description>&lt;P&gt;Did some parts of the regex go missing? It looks like it. &lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 21:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394948#M114720</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-09T21:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394949#M114721</link>
      <description>&lt;P&gt;I think it might be due to how splunk is searching for data.   A splunk ninja can correct me if I'm wrong, but I think this is what's happening here....&lt;/P&gt;

&lt;P&gt;Splunk needs to find potential events that should be returned in your search.  To do that, it will find the field/value pairs in your search, e.g. Sp=ABC12.  It will then grab the value and use that as a keyword to find related events.  So in this case, it would be doing a search for the keyword ABC12.&lt;/P&gt;

&lt;P&gt;However, when Splunk is indexing events, it finds keywords based on major/minor breakers (defined in segmenters.conf I think), e.g. space, dots, dashes, underscores, etc.  So in your events, you'll have keywords for ABC12I, AAA, ABC12I, ABC12O, CCC etc.  But there is no keyword for ABC12.  So your search is not finding any results to return.  &lt;/P&gt;

&lt;P&gt;And that's why it does work when you specify the wildcard, because then it does match the keywords in your events.  Also, if you made it an index-time extraction instead of a search-time extraction, then it would then as well.  Because the entire Sp=ABC12 would get indexed with the data, so it would return those events in this case.&lt;/P&gt;

&lt;P&gt;If I am correct here and you want more details, check out Martin Muller's session from .conf - both &lt;A href="https://conf.splunk.com/files/2017/slides/fields-indexed-tokens-and-you.pdf"&gt;the slides&lt;/A&gt; and recording are available&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 00:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394949#M114721</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2018-05-10T00:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394950#M114722</link>
      <description>&lt;P&gt;You are probably running in to this well-known problem:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2011/10/07/cannot-search-based-on-an-extracted-field/"&gt;http://blogs.splunk.com/2011/10/07/cannot-search-based-on-an-extracted-field/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The solution is to put this into fields.conf in the same directory that you have your field extractions (where props.conf is):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Sp]
INDEXED_VALUE = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See this Q*A for a GREAT explanation from @cpride (you won't find many where the UNaccepted answer has more votes that the accepted one):&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/326291/why-am-i-getting-inconsistent-event-counts-when-us.html"&gt;https://answers.splunk.com/answers/326291/why-am-i-getting-inconsistent-event-counts-when-us.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 04:28:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394950#M114722</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-10T04:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394951#M114723</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I try to explain better.&lt;BR /&gt;
I want an index-time field called "Sp".&lt;BR /&gt;
My inputs.conf is:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;[monitor:///log/logServer/file.log]&lt;/LI&gt;
&lt;LI&gt;disabled = false&lt;/LI&gt;
&lt;LI&gt;index = test01&lt;/LI&gt;
&lt;LI&gt;sourcetype = file-test&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;My props.conf is:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;[file-test]&lt;/LI&gt;
&lt;LI&gt;NO_BINARY_CHECK = 1&lt;/LI&gt;
&lt;LI&gt;SHOULD_LINEMERGE=false&lt;/LI&gt;
&lt;LI&gt;pulldown_type = 1&lt;/LI&gt;
&lt;LI&gt;TRANSFORMS-filter_logs = extract_fields-test&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;My transforms.conf is:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;[extract_fields-test]&lt;/LI&gt;
&lt;LI&gt;REGEX = (?\d+-\d+-\d+\s+\d+:\d+:\d+,\d+)\s+(?\w{5})(?\w{1})_&lt;/LI&gt;
&lt;LI&gt;FORMAT = Ts::"$1" Sp::"$2" Tsp::"$3"&lt;/LI&gt;
&lt;LI&gt;WRITE_META = true&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;My log File is:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;09-05-2018 10:12:15,123 ABC12I_AAA&lt;/LI&gt;
&lt;LI&gt;09-05-2018 10:12:15,123 ABC12I_BBB&lt;/LI&gt;
&lt;LI&gt;09-05-2018 10:12:15,123 ABC12O_CCC&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Index time extration creates the Key "Sp" (for the 3 events) but I am not able to search using Sp=ABC12 without wildcards.&lt;/P&gt;

&lt;P&gt;I want to create an index-time field called Sp and I want to be able to search the field without wildcards&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:30:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394951#M114723</guid>
      <dc:creator>gtonti</dc:creator>
      <dc:date>2020-09-29T19:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394952#M114724</link>
      <description>&lt;P&gt;UPDATE: the solution I adopted is the one shown over. To solve I added the fields.conf in the search head in the "local" folder of my app&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 06:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394952#M114724</guid>
      <dc:creator>gtonti</dc:creator>
      <dc:date>2018-05-15T06:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394953#M114725</link>
      <description>&lt;P&gt;Looks like the devs added a nice workaround that allows you to modify the lispy to search for both the indexed value in an event, as well as a fully indexed field. Can be very useful if you have cases where the same field name is used in different ways. &lt;BR /&gt;
Add the following to fields.conf on the SH:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myfield]
INDEXED=false
INDEXED_VALUE=[OR &amp;lt;VALUE&amp;gt; myfield::&amp;lt;VALUE&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Apr 2020 12:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394953#M114725</guid>
      <dc:creator>bontesl</dc:creator>
      <dc:date>2020-04-21T12:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why am i unable to search a value in an extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394954#M114726</link>
      <description>&lt;P&gt;Thanks @woodcock  !&lt;BR /&gt;
Although they say in the blog post that the issue was resolved post version 4.3 I've just faced it with version 6.6.3.&lt;/P&gt;

&lt;P&gt;Adding the fields.conf resolved the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 10:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-i-unable-to-search-a-value-in-an-extracted-field/m-p/394954#M114726</guid>
      <dc:creator>efika</dc:creator>
      <dc:date>2020-05-07T10:56:22Z</dc:date>
    </item>
  </channel>
</rss>

