<?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: Problem with search for field=value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23261#M4127</link>
    <description>&lt;P&gt;It is possible that Splunk is not sure whether to treat the values as a number or a string.&lt;BR /&gt;&lt;BR /&gt;
Try defining it as a string after the extraction and before the search.  See the details here:&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/11131/how-to-typecast-an-integer-as-a-string-literal"&gt;http://splunk-base.splunk.com/answers/11131/how-to-typecast-an-integer-as-a-string-literal&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2013 14:20:36 GMT</pubDate>
    <dc:creator>lukejadamec</dc:creator>
    <dc:date>2013-08-02T14:20:36Z</dc:date>
    <item>
      <title>Problem with search for field=value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23260#M4126</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;When I'm indexing my logs, I extract a field called "file_date" from my source. The field is of the form 2013-07-31_01-05-08. &lt;/P&gt;

&lt;P&gt;I have some problems when I want to search for a specific file_date.&lt;BR /&gt;
Say I want to show all events where file_date = 2013-03-20_21-14-36, and I know that there are 71 events with that value.&lt;/P&gt;

&lt;P&gt;If I search for this I get no matching events (I tried qoutes, escaping _ and -)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file_date=2013-03-20_21-14-36
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if I run a search for whatever before it works. Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | search file_date=2013-03-20_21-14-36
file_date=* | search file_date=2013-03-20_21-14-36
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a total of 1525 different events, all with this field, and all of them are from this year (starts with 2013), if I run a search like these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file_date=* 
* | search file_date=2013*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get 1525 events, but if I search for &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file_date=2013*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I only get 72 events.&lt;/P&gt;

&lt;P&gt;Does anybody know how to fix this problem?&lt;/P&gt;

&lt;P&gt;(In case someone is wondering, the fields are extracted and are showing up in the fields list. &lt;BR /&gt;
I also have an id field which is extracted in the same way, but only consist of 6 digits, and when I search for that field everything works as normal.)&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 13:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23260#M4126</guid>
      <dc:creator>gelica</dc:creator>
      <dc:date>2013-08-02T13:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with search for field=value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23261#M4127</link>
      <description>&lt;P&gt;It is possible that Splunk is not sure whether to treat the values as a number or a string.&lt;BR /&gt;&lt;BR /&gt;
Try defining it as a string after the extraction and before the search.  See the details here:&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/11131/how-to-typecast-an-integer-as-a-string-literal"&gt;http://splunk-base.splunk.com/answers/11131/how-to-typecast-an-integer-as-a-string-literal&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 14:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23261#M4127</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-08-02T14:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with search for field=value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23262#M4128</link>
      <description>&lt;P&gt;I think you might be running into this: &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;</description>
      <pubDate>Fri, 02 Aug 2013 17:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23262#M4128</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-08-02T17:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with search for field=value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23263#M4129</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;file_date=TERM(2013-03-20_21-14-36)&lt;/CODE&gt;. More details here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/68584/why-does-my-search-not-find-the-%5C_"&gt;http://splunk-base.splunk.com/answers/68584/why-does-my-search-not-find-the-\_&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 17:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-search-for-field-value/m-p/23263#M4129</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-08-02T17:45:30Z</dc:date>
    </item>
  </channel>
</rss>

