hi again,
i tried to replicate what you have done, but i think the field type that is used for the ip address data i wrong. is there a way to change this on the fly? / add the field type. from my understanding your example needs the field type to be ip address related.
i can't get it to return data if i query a cidr range as above
GET cisco-asa-2017.05.21/_search
{
"query": {
"term": {
"src_ip": "172.0.0.0/16"
}
}
}
result
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 4,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
but if i change it to a specific ip
GET 2017.05.21/_search
{
"query": {
"term": {
"src_ip": "xxx.xxx.xxx.xxx"
}
}
}
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 4,
"failed": 0
},
"hits": {
"total": 1887,
"max_score": 4.195242,
"hits": [
{
"_index": "cisco-asa-2017.05.21",
"_type": "cisco-asa",
"_id": "AVwoTsO86oBl3j97sYRj",
"_score": 4.195242,
"_source": {
"xlate_type": "dynamic",
"src_interface": "any",
"syslog_severity_code": 5,
"syslog_facility": "user-level",
"syslog_facility_code": 1,
"message": "<174>%ASA-6-305011: Built dynamic UDP translation from any:xxx.xxx.xxx.xxx/65121 to OUTSIDE:185.30.100.4/65121\n",
"type": "cisco-asa",
"src_xlated_ip": "xxx.xxx.xxx.xxx",
"syslog_severity": "notice",
"tags": [
"_grokparsefailure"
],
"src_ip": "xxx.xxx.xxx.xxx",
"src_port": "65121",
"protocol": "UDP",
"@timestamp": "2017-05-21T00:01:09.382Z",
"@version": "1",
"host": "xxx.xxx.xxx.xxx",
"action": "Built",
"src_xlated_interface": "OUTSIDE"
}
},
we're in doing ok. I think my elastic-fu is not quite strong enough yet. but am i right in my assumtion that i need to somehow change the src_ip field type to "ip" for it to accept cidr ?
ideally i guess i should get thsi done in the logstash config?