Why I can't get hits by mentioning string or Number directly in kibana search bar?


(Vikas Gopal) #1

Hi Experts,

I have a situation , I am searching 2341 in discover tab . So rather mentioning baseId :2341 , I am directly mentioning 2341. So idea is to get this number/base ID anywhere in the logs.Unfortunately I got nothing , but with baseId :2341 I got 2 hits.

I checked my mapping for this field , it is string , not analyzed , now why string because it will have OR separated values like
baseId: 2341 OR 2344 OR 7861...etc

As per my understanding whatever we mention in Kibana search bar it should search for that string/number and try to match that value in the logs rt? but in my case it is not working

Please help me to understand what i am missing , I am using ES 1.7.1 with 4.1.1 kiaban on Ubuntu

Thanks
Vikas


(Vikas Gopal) #2

BTW I am using a template which will set all the string fields to not_analyzed . So I am using

{
  "template" : "*",
  "settings" : {
  "index.refresh_interval" : "5s"
},
"mappings" : {
  "_default_" : {
   "_all" : {"enabled" : true},
   "dynamic_templates" : [ {
     "string_fields" : {
       "match" : "*",
       "match_mapping_type" : "string",
       "mapping" : {
         "type" : "string", "index" : "not_analyzed"

       }
     }
   } ],
   "properties" : {
     "@version": { "type": "string", "index": "not_analyzed" },
     "geoip"  : {
       "type" : "object",
         "dynamic": true,
         "path": "full",
         "properties" : {
           "location" : { "type" : "geo_point" }
     }
    }
   }
  }
 }
}

(system) #3