i tired searching an trying.
I need to group the nested fields.
The sql query is as follows
SELECT p_application_category,Sum(p_recv_bytes) as download,p_date FROM ZLog2 $w group by p_application_category;
We need a little bit more of context so we can help you. Are you trying to translate that SQL query into an ES query? If so, how is the mapping for ZLog2 index (assuming this the name of index)? And what nested fields are you referring to?
I went through the problem with ElasticSearch sql plugin
You mean the new Elasticsearch SQL Plugin being developed that is currently unreleased? Can you give more details of the issue? What you mean by `group the nested fields? Which nestes fields?
Or did you mean some third-party SQL plugin?
i using new Elasticsearch SQL Plugin .
"curl -H "Content-Type: application/json" -XGET 'http://localhost:9200/_sql?pretty' -d 'SELECT SUM(nested(byte.Recived)) download FROM useroam_2018.05.28 Group BY nested(source.Ip) LIMIT 10'
this code collects and groups the nested fields and returns them as a grouped result download
The new official SQL plugin endpoint is
POST /_xpack/sql and not
GET /_sql (see https://www.elastic.co/guide/en/elasticsearch/reference/6.x/sql-rest.html).
I am not sure what plugin is this that answers with
GET /_sql. Maybe is this one https://github.com/NLPchina/elasticsearch-sql ? If so, this is a third-party plugin in which I am not aware of how it works.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.