How to get min value in elasticsearch curl command -


i newbie elasticsearch. want min value particular day of log line's field. kibana shows indexed data follows:

@timestamp      2015-07-30t22:22:07.071-07:00  @version        1  type        mtalogs  integerdata     052256894-0400  msgtype     received internet  msgid       qamail-4.02.0220150730080248.ijruj.email-qa-sun26@172.20.1.10  msgsize     5635  path        /opt/user1/log/mta.log  processid       23441  protocol        smtp  rcpts       pd10@myoxdomain.com  sender      pd9@myoxdomain.com  servername      mta  sid     4f9f325e-8decdb12-00003556.1  time        0  tracename       msgtrace 

i want min value of msgsize curl coomand.

my curl command follows:

curl -xget 'http://localhost:9200/_all/_search?pretty=true' -d '{     "query" : {         "bool" : {                 "must" : [                         {                         "match" : {                                 "type" : "mtalogs"                         }},                         {                         "match" : {                                 "msgtype" : "received internet"                         }}  ,                         {                         "filtered" : {                         "filter" : {                                 "range" : {                                         "@timestamp" : {                                                 "from" : "2015-07-30t00:00:00",                                                 "to" : "2015-07-30t23:59:59"                                         }                                 }                         }                         }                         }                 ]         }     },     "aggs" : {           "min_size" : {                    "min" : {                           "field" : "msgsize"                     }            }      } }' 

but getting exception follows:

 "index" : "logstash-2015.07.30",       "shard" : 4,       "status" : 500,       "reason" : "classcastexception[org.elasticsearch.index.fielddata.plain.pagedbytesindexfielddata cannot cast org.elasticsearch.index.fielddata.indexnumericfielddata]"     } ]   },   "hits" : {     "total" : 0,     "max_score" : null,     "hits" : [ ]   },   "aggregations" : {     "min_size" : {       "value" : null     }   } } 

though parsing fields correctly as:

msgsize=%{int:msgsize:int} 

can me here, went wrong?

the exception typical of situation documents have been indexed logstash previous configuration msgsize field wasn't mapped int , configuration changed. end documents having msgsize string , others msgsize int, hence exception.

the solution see here, wiping indexes , re-indexing logs latest configuration.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -