Hello,
My question is Trigger alert when Sourc-ip and Destination-ip is same but different destination port trigger alert
and I am facing problem here is my configuration.
PUT _xpack/watcher/watch/vertical-port-scan
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input" : {
"search" : {
"request" : {
"indices" : [
"firewall-vertical-port-scan"
],
"body" : {
"query" : {
"bool" : {
"must": [
{
"terms": {
"field": "dstPort.keyword"
},
"bool": {
"must": [
{
"match_phrase": {
"srcIp.keyword": {
"query": "20.36.219.28"
}
}
},
{
"match_phrase": {
"dstIp.keyword": {
"query": "10.18.13.85"
}
}
},
{
"range": {
"@timestamp": {
"gte": 1562856683309,
"lte": 1570632683309,
"format": "epoch_millis"
}
}
}
],
"filter": [
{
"match_all": {}
},
{
"match_all": {}
}
],
"should": [],
"must_not": []
}
},
{
}
]
}
}
}
}
}
},
"condition" : {
"compare" : { "ctx.payload.hits.total" : { "gt" : 0 }}
},
"throttle_period": "15m",
"actions" : {
"email_admin" : {
"email" : {
"to" : ["abcd@xyz.com"],
"subject" : "abcd",
"body": {
"text": "TimeStamp:{{#ctx.payload.hits.hits}} {{_source.@timestamp}} {{/ctx.payload.hits.hits}}"
}
}
}
}
}
But is is giving error
kindly help.