How do I get my "_value" from my webhook to be in a Json format or even better would be just to display the output of the GET query in a Json format.
Current watcher:
{
"trigger": {
"schedule": {
"interval": "2m"
}
},
"input": {
"http": {
"request": {
"scheme": "http",
"host": "host.eu-west-1.aws.found.io",
"port": 9200,
"method": "GET",
"path": "_cat/indices/tid*?format=json",
"params": {},
"headers": {},
"auth": {
"basic": {
"username": "test",
"password": "A"
}
}
}
}
},
"actions": {
"web_hook": {
"webhook": {
"scheme": "https",
"host": "api.test.com",
"port": 443,
"method": "POST",
"path": "/private/staging/tenant/index/size",
"params": {},
"headers": {
"x-api-key": "password",
"Content-Type": "application/json"
},
"body": "{{#toJson}}ctx.payload{{/toJson}}_value"
}
}
},
"throttle_period_in_millis": 120000
}
Current output:
{
"_headers": {
"date": [
"Fri, 01 Jun 2018 11:45:22 GMT"
],
"server": [
"123"
],
"connection": [
"keep-alive"
],
"content-type": [
"text\/plain; charset=UTF-8"
],
"x-found-handling-server": [
"1.1.1.1"
],
"x-found-handling-cluster": [
"Test"
],
"x-found-handling-instance": [
"instance-ID"
]
},
"_value": "green open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.14 cvQK61shSBCJd8DzFSlOwA 5 1 235899 0 560.7mb 281.2mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.1 QH4m8jiBTnGDLQWsmFfgcQ 5 1 724745 0 1.4gb 762.8mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.7 cNo3wIlkR1yCh6bqQZC9wA 5 1 248536 0 568.9mb 284.4mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.22 l7L7DZ3cSz6idcYAfmid5A 5 1 666160 0 1.3gb 695.4mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.29 i9Gmj95jRDWMQ0xhWuJ6ew 5 1 611943 0 1.2gb 641mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.15 wy0xRG5dSgezr2dZ0e6GYA 5 1 217476 0 544.7mb 272.3mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.21 ZKYOei6xQ6CDoQmrMgG7iA 5 1 773255 0 1.5gb 807mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.11 UXmMH9DjQKCbUaxPJbxkAQ 5 1 825112 0 1.7gb 880.8mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.5 hFUsci4VTcqoVtzZYV3RkA 5 1 499594 0 1gb 528.7mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.24 l6Qsk7dmQw-cELv_R5sZrw 5 1 836594 0 1.6gb 848mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.15 5R_xbylFSv-bTY-5L9hZmQ 5 1 794937 0 1.5gb 810.2mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.5 x6McWd3TQYakPoN5gXcuMw 5 1 257549 0 590.9mb 295.4mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.30 cv-wKJ5tSROGreoy5_hzdg 5 1 180000 0 514.3mb 257.1mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.6 F-0YJspPRZmGdlKsCa8WFg 5 1 230211 0 559.7mb 280.6mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.05.16 iASteWyLTdunmr05vpUfLw 5 1 743229 0 1.6gb 849.3mb\ngreen open tid.67a76f18-487b-4033-a3d7-b706a8aa04f0.2018.04.10 9C0PrrnIT8KMc2GxsHd4Yw 5 1 768519 0 1.5gb 800.1mb\n
}
Any help is appreciated.