marwojt
November 10, 2020, 9:29am
1
Hi,
I need help with adding node filter to signals settings.
I tried this from Kibana devtools
PUT /_signals/tenant._main.node_filter
“signals:true”
and get
PUT /_signals/tenant.admin_tenant.node_filter
{
“error” : “Incorrect HTTP method for uri [/_signals/tenant.admin_tenant.node_filter?pretty=true] and method [PUT], allowed: [POST]”,
“status” : 405
}
br,
Mariusz
cstaley
November 10, 2020, 9:54am
2
marwojt:
PUT /_signals/tenant.admin_tenant.node_filter
The path component settings
is missing here. Try PUT /_signals/settings/tenant.admin_tenant.node_filter
marwojt
November 10, 2020, 10:28am
3
I try an now i get
{
“status” : 400,
“error” : “‘tenant.admin_tenant.node_filter’: No content to map due to end-of-input\n at [Source: (String)""; line: 1, column: 0]”,
“detail” : {
“tenant.admin_tenant.node_filter” : [
{
“error” : “No content to map due to end-of-input\n at [Source: (String)""; line: 1, column: 0]”
}
]
}
}
cstaley
November 10, 2020, 11:28am
4
What tool do you use to do the requests? If you use curl or another command line tool, can you please give the whole command line? If you use another tool, can you please give the whole configuration?
marwojt
November 10, 2020, 12:58pm
5
Before i try from Kibana Devtools. Now i from curl and it works
curl -k -u xxxx -XPUT “https://xxxxxx:9200/_signals/settings/tenant.admin_tenant.node_filter ”
And have
{“active”:“true”,“tenant”:{“admin_tenant”:{“active”:“true”,“node_filter”:“”},“_main”:{“active”:“true”},“signals”:{“active”:“true”}}}
How can I add filter for node.attr.signals:true?
br,
MW
cstaley
November 10, 2020, 1:08pm
6
You have to specify the value in the body of the request. With curl, you can do it with the -c
option. For example:
curl -k -u xxxx -H "Content-Type: application/json" -XPUT “https://xxxxxx:9200/_signals/settings/tenant.admin_tenant.node_filter” -c '"signals:true"'
(Note that '"signals:true"'
is written first in single quotes and then in double quotes because the shell strips the single quotes)
marwojt
November 10, 2020, 1:31pm
7
First i delete it
curl -k -u xxxx -XDELETE “xxxx:9200/_signals/settings/tenant.admin_tenant.node_filter”
and then
curl -k -u xxxx -XPUT “https://xxxx:9200/_signals/settings/tenant.admin_tenant.node_filter ” -c ‘“signals:true”’
{“result”:“updated”}
and is still like that
{“active”:“true”,“tenant”:{“admin_tenant”:{“active”:“true”,“node_filter”:“”},“_main”:{“active”:“true”},“signals”:{“active”:“true”}}}
Any idea
marwojt
November 10, 2020, 3:22pm
8
This work for me
curl -k -u xxxx -XPUT “xxxx:9200/_signals/settings/tenant.admin_tenant.node_filter” -H ‘Content-Type: application/json’ -d ‘“signals:true”’
Now i have
{“active”:“true”,“tenant”:{“admin_tenant”:{“active”:“true”,“node_filter”:“signals:true”},“_main”:{“active”:“true”},“signals”:{“active”:“true”}}}
So as I understood from documentation watchers will be schedule only on node with “node.attr.signals: true” ?
br,
MW