We typically get that type of error when the nested fields you're querying on are either not mapped or not mapped as nested properties.
Can you check your mapping and see if the country is mapped as a nested property of httpRequest? if it is, then it also means it's mapped so the query might need to change a bit".
To check your mapping (you can use Kibana's Console app for these requests):
GET /filebeat*/_mapping
The mapping might have any fields, so you can narrow down the results to only include the httpRequest using:
GET /filebeat*/_mapping/field/httpRequest
or just the mapping for the country field:
GET /filebeat*/_mapping/field/httpRequest.country
Note: I've given links for the 8/6 version (the most recent), so you might need to change the stack version on the pages that the links points to.
There's way more info in the docs that including examples and things to watch out for, in case you get stuck.
Hi @Shiva_Subramaniyan you'll need to map it as a nested field in your index.
One can't change the mapping for a field that already exists in the index, so you'll first need to see if the parent (httpRequest) is mapped.
If it is, then you won't be able to change it to a nested field containing country. You'll need to create a new index with a nested field type for httpRequest and then reindex all your data from the current index into the new one.
Use the mapping that you got in 1 as the basis for the new index and then declare httpRequest as a nested field with the properties country and clientIp, headers and any others that are also nested in httpRequest.
You can use the same mappings for all the other fields in your index that you don't need to change.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.