Response Filteringを使うと、必要なフィールドだけ返すことができます。
https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#common-options-response-filtering
必要な_source以下の項目だけを指定しておけば、metaデータのfieldも返らなくなります。
使用例
POST metricbeat-6.6.0/_search?filter_path=hits.hits._source.host.os.name
{
"query": {
"match_all": {}
}
}
返される結果例
json
1{
2 "hits" : {
3 "hits" : [
4 {
5 "_source" : {
6 "host" : {
7 "os" : {
8 "name" : "Windows 8.1 Pro"
9 }
10 }
11 }
12 },
13 {
また、jsonの{や”の記号部分すらも削りたい、ということであれば、SQL queryでフォーマットをCSVに指定するなどが考えられそうです。
https://www.elastic.co/products/stack/elasticsearch-sql
POST _xpack/sql?format=csv
{
"query": "SELECT host.os.name FROM \"metricbeat-6.6.0\" LIMIT 10"
}
とすると、こうなります。
csv
1host.os.name
2Windows 8.1 Pro
3Windows 8.1 Pro
4Windows 8.1 Pro
5Windows 8.1 Pro
6Windows 8.1 Pro
7Windows 8.1 Pro
8Windows 8.1 Pro
9Windows 8.1 Pro
10Windows 8.1 Pro
11Windows 8.1 Pro
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/02/03 11:03