script_fields are to create custom fields that get returned out of the documents that match your query. You cannot query them, so effectively your query queries a non existing field hence it returns no documents.
Can you elaborate on what your documents look like and how you would like to query them? We may find a a way to help then. script_fields may be a way, but maybe there are others.
Were working on an analytics framework based on ELK.
We have many types of logs ranging from simple firewall logs (like the one in the original question), to more complex logs like windows services (dlls paths, service names etc..)
One of the use cases for our analysts is to create and interact transparently with scripted fields.
For example:
a script that will extract the containing directory of the dll (instead of full path), and than group by directories.
The flow would be:
user creates a directory field
user asks for aggregation on that field (count for example)
the framework would than convert the script_field to a scripted aggregation (it returns only aggregated results OR hits, never both in the same query)
internally we keep track of the field name and script that the user asked for and do the before querying elasticsearch.
We wanted to implement a similar feature for the hits (user creates directory field, than wants to match a specific directory).
I guess we could have done something similar with scripted filter, but I wished to avoid it because, we rely on the lucene query string for simple filters (and wrapper functions for aggregations).
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.