<?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 Why are events not returned for a search on a search-time extracted field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221147#M64992</link>
    <description>&lt;P&gt;We have a field extraction in apps/search/local/props.conf like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_glog_kv]
...
EXTRACT-my_glog_kv = ^(?&amp;lt;severity&amp;gt;[IEWF])
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And example log event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;F0106 09:02:03.592142  4628 hal_impl.cc:1042] Check failed: logged_ptr != nullptr id="106"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So we expect the Splunk field extraction to put 'F' into the severity field, but for some reason this search does NOT find the above event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... severity=F
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Interestingly, all of these searches do succeed, and Field:severity Value:F is listed in the event viewer  in Splunk Web.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... severity=F source=mysource.log
... severity=F nullptr
... severity=F*
... severity=*F
... | regex severity=F
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help as to why simple &lt;CODE&gt;severity=F&lt;/CODE&gt; search does not work?&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2016 00:35:48 GMT</pubDate>
    <dc:creator>rgsage</dc:creator>
    <dc:date>2016-01-08T00:35:48Z</dc:date>
    <item>
      <title>Why are events not returned for a search on a search-time extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221147#M64992</link>
      <description>&lt;P&gt;We have a field extraction in apps/search/local/props.conf like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_glog_kv]
...
EXTRACT-my_glog_kv = ^(?&amp;lt;severity&amp;gt;[IEWF])
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And example log event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;F0106 09:02:03.592142  4628 hal_impl.cc:1042] Check failed: logged_ptr != nullptr id="106"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So we expect the Splunk field extraction to put 'F' into the severity field, but for some reason this search does NOT find the above event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... severity=F
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Interestingly, all of these searches do succeed, and Field:severity Value:F is listed in the event viewer  in Splunk Web.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... severity=F source=mysource.log
... severity=F nullptr
... severity=F*
... severity=*F
... | regex severity=F
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help as to why simple &lt;CODE&gt;severity=F&lt;/CODE&gt; search does not work?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 00:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221147#M64992</guid>
      <dc:creator>rgsage</dc:creator>
      <dc:date>2016-01-08T00:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why are events not returned for a search on a search-time extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221148#M64993</link>
      <description>&lt;P&gt;This is happens because of two facts that are not exactly obvious. One problem is that the "F" you are looking for is not a &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Data/Abouteventsegmentation"&gt;segment&lt;/A&gt; of your event. Furthermore, Splunk will fetch events from disk based on segments - field extraction only happens after the events are fetched.&lt;BR /&gt;
If you don't want to read up on this rather technical chapter of splunk, suppose for example you have data like this: event a)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;valid command df
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and b)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;invalid command asdfg
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now imagine you want to search for events with valid commands using &lt;CODE&gt;search "valid command"&lt;/CODE&gt;. Splunk will not return event b) even though it literally contains your string, which is the behavior you would expect. The segments this event contains are &lt;CODE&gt;invalid&lt;/CODE&gt; and &lt;CODE&gt;command&lt;/CODE&gt;, because they are separated by a whitespace. If you use &lt;CODE&gt;search "*valid command"&lt;/CODE&gt;, you will get both event a) and b) - which is also not surprising.&lt;/P&gt;

&lt;P&gt;In the above example, Splunk works as you would expect. In your case unfortunately, this behavior is not giving you the desired result, but it is because of the same reasons: What splunk fetches from disk is determined by segments, and your event doesn't contain a segment "f". Therefore, there are no events when it comes to search-time field extraction.&lt;BR /&gt;
I hope this helps you understand the issue better. Feel free to come back with any further questions.&lt;BR /&gt;
Oh and thanks to @martin_mueller for assistance in this matter!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 15:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221148#M64993</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-01-08T15:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why are events not returned for a search on a search-time extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221149#M64994</link>
      <description>&lt;P&gt;Thank you, this is a great answer.  &lt;/P&gt;

&lt;P&gt;Also explains the further mystery of why our severity=F query sometimes did work. For example, severity=F would find this event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;F0106 09:02:03.592142  4628 other.cc:1042] command="f"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I guess because the "f" is a segment so Splunk fetches (and presumably field-extracts) the event, then discovers hey there is a match on severity=F field.&lt;/P&gt;

&lt;P&gt;But this does seem to be a pretty hidden and serious limitation on Splunk search time field extractions: search time field extractions only work on event &lt;EM&gt;segments&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;I suppose our only option would be make severity an indexed field (index-time extraction).&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 17:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221149#M64994</guid>
      <dc:creator>rgsage</dc:creator>
      <dc:date>2016-01-08T17:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why are events not returned for a search on a search-time extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221150#M64995</link>
      <description>&lt;P&gt;Good point - one solution is to make it an indexed field. This implies however any downsides that come with that method.&lt;BR /&gt;
You could also try to edit your data, either at its source (if you are in control of the application producing these logs) or with SEDCMD during indexing: if you insert a whitespace between the initial two characters, splunk will get segmentation right from the beginning.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2016 08:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221150#M64995</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-01-10T08:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why are events not returned for a search on a search-time extracted field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221151#M64996</link>
      <description>&lt;P&gt;I wouldn't go as far as saying "search time field extractions only work on event segments" - more accurately, "extracting search time fields from a partial segment requires additional configuration".&lt;/P&gt;

&lt;P&gt;For example, you could tell Splunk to not use the optimization step of only loading events containing the segment &lt;CODE&gt;f&lt;/CODE&gt; off disk before applying the regular expression in fields.conf - it'll be slower, but the extraction will work.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 17:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-events-not-returned-for-a-search-on-a-search-time/m-p/221151#M64996</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-01-13T17:39:03Z</dc:date>
    </item>
  </channel>
</rss>

