As of right now, users are unable to query using regex via the Kibana dashboard. There is a way to write a raw elasticsearch query that uses regex though:
https://www.elastic.co/guide/en/elastic ... query.html
Two caveats:
- We store most message fields as non-analyzed generic strings. This means that as far as querying is concerned, everything is lower-case.
- You will need to do additional escaping in your regex for it to play nice with elasticsearch.
The easiest way to tackle this would be a grok filter that parses out the value TKM_ID is being compared to. Then you could just filter on that field where the field is greater than 0. This violates the following condition you've mentioned though:
_asp_ wrote:without changing the logstash parsing
I was able to match
TKM_ID by itself like so:
Code: Select all
[root@localhost ~]# curl -XPOST "http://localhost:9200/_search?pretty" -d '{"query":{"regexp":{"message":".*tkm_id.*"}}}'
{
"took" : 28,
"timed_out" : false,
"_shards" : {
"total" : 135,
"successful" : 135,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "logstash-2016.09.26",
"_type" : "import_raw",
"_id" : "AVdnaCI8S27C0bsfbjLN",
"_score" : 1.0,
"_source":{"message":"DB_TMMESSAGES: (NO/PARTIAL TIME RANGE SYSDATE-1/SYSDATE+1), XSQL-Filter: '(TKM_ID >= -1059235127 AND TKM_INBOUND = TRUE)', Alias-Sort: '+TKM_ID', #0...#49 (PageSize: 50), , Fetched: 0, 639 ms\n","@version":"1","@timestamp":"2016-09-26T16:51:00.263Z","type":"import_raw","tags":["import_raw"],"host":"192.168.67.97"}
}, {
"_index" : "logstash-2016.09.26",
"_type" : "import_raw",
"_id" : "AVdnaG-SS27C0bsfbjLu",
"_score" : 1.0,
"_source":{"message":"DB_TMMESSAGES: (NO/PARTIAL TIME RANGE SYSDATE-1/SYSDATE+1), XSQL-Filter: '(TKM_ID >= 3000 AND TKM_INBOUND = TRUE)', Alias-Sort: '+TKM_ID', #0...#49 (PageSize: 50), , Fetched: 0, 639 ms\n","@version":"1","@timestamp":"2016-09-26T16:51:19.636Z","type":"import_raw","tags":["import_raw"],"host":"192.168.67.97"}
} ]
}
}
Trying to match the
< and
> characters is proving difficult. I'll update if I figure it out.