Getting Error While creating Watcher execution!

Hi Elastic search Team,

someone please explain why im getting "No handler found for uri [/_xpack/watcher/watch/prod-SL3b_jvm_memkpi/_execute;] and method [POST]" while trying to execute watcher created ??

Thanks in advance
Naveena

what version r u using ? Can you please paste your entire watch here and the logs as well ?

Thanks
Rashmi

Can you return the output of GET /_cat/plugins? Are you sure x-pack is installed on all nodes?

Hi @spinscale ,

the output of GET /_cat/plugins? is :

tiebreaker-0000000000 found-elasticsearch 6.2.2
tiebreaker-0000000000 ingest-geoip 6.2.2
tiebreaker-0000000000 ingest-user-agent 6.2.2
tiebreaker-0000000000 repository-s3 6.2.2
tiebreaker-0000000000 x-pack-core 6.2.2
tiebreaker-0000000000 x-pack-deprecation 6.2.2
tiebreaker-0000000000 x-pack-graph 6.2.2
tiebreaker-0000000000 x-pack-logstash 6.2.2
tiebreaker-0000000000 x-pack-ml 6.2.2
tiebreaker-0000000000 x-pack-monitoring 6.2.2
tiebreaker-0000000000 x-pack-security 6.2.2
tiebreaker-0000000000 x-pack-upgrade 6.2.2
tiebreaker-0000000000 x-pack-watcher 6.2.2
instance-0000000001 found-elasticsearch 6.2.2
instance-0000000001 ingest-geoip 6.2.2
instance-0000000001 ingest-user-agent 6.2.2
instance-0000000001 repository-s3 6.2.2
instance-0000000001 x-pack-core 6.2.2
instance-0000000001 x-pack-deprecation 6.2.2
instance-0000000001 x-pack-graph 6.2.2
instance-0000000001 x-pack-logstash 6.2.2
instance-0000000001 x-pack-ml 6.2.2
instance-0000000001 x-pack-monitoring 6.2.2
instance-0000000001 x-pack-security 6.2.2
instance-0000000001 x-pack-upgrade 6.2.2
instance-0000000001 x-pack-watcher 6.2.2
instance-0000000002 found-elasticsearch 6.2.2
instance-0000000002 ingest-geoip 6.2.2
instance-0000000002 ingest-user-agent 6.2.2
instance-0000000002 repository-s3 6.2.2
instance-0000000002 x-pack-core 6.2.2
instance-0000000002 x-pack-deprecation 6.2.2
instance-0000000002 x-pack-graph 6.2.2
instance-0000000002 x-pack-logstash 6.2.2
instance-0000000002 x-pack-ml 6.2.2
instance-0000000002 x-pack-monitoring 6.2.2
instance-0000000002 x-pack-security 6.2.2
instance-0000000002 x-pack-upgrade 6.2.2
instance-0000000002 x-pack-watcher 6.2.2

hi @rashmi,
we are using 6.2.2
the watcher im trying execute is:

PUT _xpack/watcher/watch/mwsspm_spm_jvm_memkpi
{
"trigger": {
"schedule": {
"interval": "100s"
}
},
"input": {
"search": {
"request": {
"indices": "mws-spm",
"types": "doc",
"body": {
"query": {
"match_all": {}
},
"sort":[
{
"monitoredComponentStats.timeStamp":{
"order": "desc"
}
}
]
}
}
}
},
"condition": {
"compare":{
"ctx.payload.hits.hits.0._source.monitoredComponentStats.2.runtimeState.kpi.1.value": {
"gt": "ctx.payload.hits.hits.0._source.monitoredComponentStats.2.runtimeState.kpi.1.marginalValue"
}
}
},
"actions": {
"send_email" : {
"email": {
"to": "CloudManagedServiceESB@softwareag.com",
"subject": "QA server ping status",
"body": "server {{ctx.payload.hits.hits.0._source.monitoredComponentStats.2.runtimeComponentId}} is having KPI's {{ctx.payload.hits.hits.0._source.monitoredComponentStats.2.runtimeState.kpi.1.displayName}} with current value {{ctx.payload.hits.hits.0._source.monitoredComponentStats.2.runtimeState.kpi.1.value}} and marginal value is {{ctx.payload.hits.hits.0._source.monitoredComponentStats.2.runtimeState.kpi.1.marginalValue}}"
}
}
}
}

POST _xpack/watcher/watch/mwsspm_spm_jvm_memkpi/_execute;

Thanks,
Naveen

can you paste (and also please format), what the response from your PUT Watch call is, please?

Hi @spinscale
watcher code is below :
PUT _xpack/watcher/watch/umspm_spm_jvm_memkpi
{
"trigger": {
"schedule": {
"interval": "100s"
}
},
"input": {
"search": {
"request": {
"indices": "um-spm",
"types": "doc",
"body": {
"query": {
"match_all": {}
},
"sort":[
{
"monitoredComponentStats.timeStamp":{
"order": "desc"
}
}
]
}
}
}
},
"condition": {
"compare":{
"ctx.payload.hits.hits.0._source.monitoredComponentStats.1.runtimeState.kpi.1.value": {
"gt": "ctx.payload.hits.hits.0._source.monitoredComponentStats.1.runtimeState.kpi.1.marginalValue"
}
}
},
"actions": {
"send_email" : {
"email": {
"to": "CloudManagedServiceESB@softwareag.com",
"subject": "QA server ping status",
"body": "server {{ctx.payload.hits.hits.0._source.monitoredComponentStats.1.runtimeComponentId}} is having KPI's {{ctx.payload.hits.hits.0._source.monitoredComponentStats.1.runtimeState.kpi.1.displayName}} with current value {{ctx.payload.hits.hits.0._source.monitoredComponentStats.1.runtimeState.kpi.1.value}} and marginal value is {{ctx.payload.hits.hits.0._source.monitoredComponentStats.1.runtimeState.kpi.1.marginalValue}}"
}
}
}
}

response is:

" No handler found for uri [/_xpack/watcher/watch/umspm_spm_jvm_memkpi/_execute;] and method [POST] "

Request and response URLs do not match, this is not the response from the first call. Please post the exact response, including any JSON. Thanks

No , in the last reply i have mentioned same watcher code as well as response for the same,

Thanks
Naveena

The URL of your request is xpack/watcher/watch/umspm_spm_jvm_memkpi

The URL in the response is /_xpack/watcher/watch/umspm_spm_jvm_memkpi/_execute

Those are different endpoints.

I doubt that those two belong together. Very much.

Hi @spinscale,
But let me show u How im Executing it .pls refer image file.

Thanks,
Naveena

Please do not paste images, but snippets. These screenshots are impossible to see for visually impaired people and you could just copy paste the output of the two windows shown.

There is an semicolon at the the end, which does not belong there.

Hi @spinscale,

Yes the semicolon was the problem, Thanks for letting me know.

problem solved now.!!

There is an semicolon at the the end, which does not belong there.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.