DockerでElasticStackを公式のイメージで実行しています。DockerのLogstash - 2つのイベントを1つのイベントに結合する
Cannot create pipeline {:reason=>"Couldn't find any filter plugin named 'aggregate'. Are you sure this is correct? Trying to load the aggregate filter plugin resulted in this error: Problems loading the requested plugin named aggregate of type filter. Error: NameError NameError"}
どのように私はまた、100%わからないんだけど、言った:同じRequestIDを持つイベントを結合する集計プラグイン - しかし、私は現在、私はLogstashを使用しようとすると、次のエラーメッセージを受信していますLogstashを使用 - 1つのイベントに以下のサンプルのイベントを組み合わせて集計プラグイン:
{
"@t": "2017-10-16T20:21:35.0531946Z",
"@m": "HTTP GET Request: \"https://myapi.com/?format=json&trackid=385728443\"",
"@i": "29b30dc6",
"Url": "https://myapi.com/?format=json&trackid=385728443",
"SourceContext": "OpenAPIClient.Client",
"ActionId": "fd683cc6-9e59-427f-a9f4-7855663f3568",
"ActionName": "Web.Controllers.API.TrackController.TrackRadioLocationGetAsync (Web)",
"RequestId": "0HL8KO13F8US6:0000000E",
"RequestPath": "/api/track/radiourl/385728443"
}
{
"@t": "2017-10-16T20:21:35.0882617Z",
"@m": "HTTP GET Response: LocationAPIResponse { Location: \"http://sample.com/file/385728443/\", Error: null, Success: True }",
"@i": "84f6b72b",
"Response":
{
"Location": "http://sample.com/file/385728443/",
"Error": null,
"Success": true,
"$type": "LocationAPIResponse"
},
"SourceContext": "OpenAPIClient.Client",
"ActionId": "fd683cc6-9e59-427f-a9f4-7855663f3568",
"ActionName": "Web.Controllers.API.TrackController.TrackRadioLocationGetAsync (Web)",
"RequestId": "0HL8KO13F8US6:0000000E",
"RequestPath": "/api/track/radiourl/385728443"
}
誰かが正しく、これらのイベントを組み合わせた方法でと集計が正しいプラグイン、なぜ内蔵のプラグインであれば、私を案内してもらえLogstash Docker画像の一部ではないようですか?
ドッキングウィンドウ-compose.yml内容:
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
ports:
- 9200:9200
restart: always
logstash:
image: docker.elastic.co/logstash/logstash:5.6.3
container_name: logstash
environment:
- xpack.monitoring.elasticsearch.url=http://elasticsearch:9200
depends_on:
- elasticsearch
ports:
- 10000:10000
restart: always
volumes:
- ./logstash/pipeline/:/usr/share/logstash/pipeline/
kibana:
image: docker.elastic.co/kibana/kibana:5.6.3
container_name: kibana
environment:
- xpack.monitoring.elasticsearch.url=http://elasticsearch:9200
depends_on:
- elasticsearch
ports:
- 5601:5601
restart: always
logstash /パイプライン/ empstore.conf内容:あなたのフィルターで
input {
http {
id => "empstore_http"
port => 10000
codec => "json"
}
}
output {
elasticsearch {
hosts => [ "elasticsearch:9200" ]
id => "empstore_elasticsearch"
index => "empstore-openapi"
}
}
filter {
mutate {
rename => { "RequestId" => "RequestID" }
}
aggregate {
task_id => "%{RequestID}"
code => ""
}
}
だから、単純に行かなくても二つの事象の既存のフィールドを結合する方法はありませんどのリクエストがリクエストであり、どちらがレスポンスであるかを判断するオーバーヘッドを通じて、 – wdspider
ここを見て: https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html#plugins-filters-aggregate-example4 – lotfi1991
コード=> " マップ[ 'COUNTRY_NAME'] = '都市名' => event.get( 'country_name') map ['towns'] || = [] map ['towns'] << {'town_name' => event.get( 'town_name')} event.cancel ) " – lotfi1991