に予め登録されたmushacheテンプレートでtojson使用方法。 kibanaコンソールでは、検索クエリテンプレートを保存しようとしています。Elasticsearch</p> <p>こんにちは、</p> <p>であらかじめ登録mushacheテンプレートで使用する用語は、私がElasticsearchのv5.6.3を使用する方法Elasticsearch
POST _scripts/test-json
{
"script": {
"lang": "mustache",
"source": {"query": {"filter": {"bool": {"must": [{"terms": {"beat.hostname": {{#tojson}}hostname{{/tojson}} } }] } } } }
}
}
しかし、二重引用符を除いて構文エラーが発生しました。
私はgithubの問題を見ました。 https://github.com/elastic/elasticsearch/issues/21648
この問題でサンプルのようにテンプレートを変更しましたが、構文エラーはありません。しかし、私は結果を得ることができません。コールされた後、私はランタイムエラーを得た、
POST _scripts/test-json
{
"script": {
"lang": "mustache",
"source": {"query": {"filter": {"bool": {"must": [{"terms": {"beat.hostname": ["{{#tojson}}hostname{{/tojson}}}}"] } }] } } } }
}
}
:
POST _scripts/test-json
{
"script": {
"lang": "mustache",
"source": {"query": {"filter": {"bool": {"must": [{"terms": {"beat.hostname": ["{{hostname}}"] } }] } } } }
}
}
そして、私は、テンプレートを変更しました。
{
"type": "json_parse_exception",
"reason": "Unexpected character ('h' (code 104)): was expecting comma to separate Array entries\n at [Source: org.elasticsear[email protected]396f6738; line: 1, column: 190]"
}
事前登録された検索テンプレートの用語にいくつかのパラメータを送信するにはどうすればよいですか?
ありがとうございます。