(私はELKにかなり新しいですスタックと明らかに何かを求めることがあります...)フィルタを使用してKibana/Visualizeの値をカウントしますか?
私は、このようななどの名前、住所、年齢、などのデータを、顧客の情報を記載した文書を持っている... 時には、すべてではないこれらのフィールドが存在し、それらを満たすドキュメントの数を知りたいと思います。
のようにデータが見える場合:アイデアはにのようなデータテーブル可視化Kibanaを持っていることです
PUT customers
{
"mappings": {
"customer": {
"properties": {
"id": {
"type": "integer"
},
"category": {
"type": "keyword"
},
"email": {
"type": "text"
},
"age": {
"type": "integer"
},
"address": {
"type": "text"
}
}
}
}
}
POST _bulk
{"index":{"_index":"customers","_type":"customer"}}
{"id":"1","category":"aa","email":"[email protected]"}
{"index":{"_index":"customers","_type":"customer"}}
{"id": "2", "category" : "aa", "age": "5"}
{"index":{"_index":"customers","_type":"customer"}}
{"id": "3", "category" : "aa", "email": "[email protected]", "age": "36"}
{"index":{"_index":"customers","_type":"customer"}}
{"id": "4", "category" : "bb", "email": "[email protected]", "age": "42", "address": "london"}
:
+----------+-------+-------+-----+---------+
| category | total | email | age | address |
+----------+-------+-------+-----+---------+
| aa | 3 | 2 | 2 | 0 |
| bb | 1 | 1 | 1 | 1 |
+----------+-------+-------+-----+---------+
を(例えば:私たちはカテゴリ「AAで3人の顧客を持っています";そのうち2人はメールを送った、2人は年齢を与えた、誰もその住所を与えなかった)
私はそのようなクエリでそれを行う方法を理解することができます:
POST /customers/_search?size=0
{
"aggs": {
"category": {
"terms": {
"field": "category"
},
"aggs": {
"count_email": {
"filter": {
"exists": {
"field": "email"
}
}
},
"count_age": {
"filter": {
"exists": {
"field": "age"
}
}
},
"count_address": {
"filter": {
"exists": {
"field": "address"
}
}
}
}
}
}
}
しかし私はKibana Visualizeでどのようにできるのかわかりません。 スクリプトフィールドを使用する必要がありますか? JSON入力?どうやって ?そこには良い方法がありますか?
アドバイスいただきありがとうございます。
これはあなたに適切なテーブルを与えていませんか?結果は何ですか? – AnthonyJClink
私はkibanaの開始URLを含むように私の答えを更新しました。これはあなたが必要とするものに近いですか?あなたの答えは – AnthonyJClink