Reputation: 1
I'm using ElasticSearch with Kibana for visualization. I want to build a query to match two different fields when they have the same content.
For example:
field1: address = google.com
field2: hostname = google.com
Is ist possible to match two fields without knowing their values?
Thanks!
Upvotes: 0
Views: 2848
Reputation: 7854
You can do this using painless script. The query will look as below:
{
"query": {
"bool": {
"filter": {
"script": {
"script": {
"source": "doc['address'].value == doc['hostname'].value",
"lang": "painless"
}
}
}
}
}
}
To use in kibana you can create scripted field.
Upvotes: 1