Azure Event Hubs logstash插件的示例message
:
https://pastebin.com/b8WnQHug
我想要输出:
{
"operationName": "Microsoft.ContainerService/managedClusters/diagnosticLogs/Read",
"category": "kube-apiserver",
"ccpNamespace": "5d764286d7481f0001d4b054",
"resourceId": "/SUBSCRIPTIONS/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/RESOURCEGROUPS/MY-RG/PROVIDERS/MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/MY-AKS",
"properties": {
"log": "First line from record\n Second line from another record\n Third line from another record \n etc from another recors",
"stream": "stderr",
"pod": "kube-apiserver-8b5b9cd44-khjfk",
"containerID": "4c2ddb8ba9639ae9c88f728d850d550473eb36f4eb3e1d99c3f052b87cff9357"
},
"time": "2019-10-16T13:44:16.0000000Z",
"Cloud": "Public",
"Environment": "prod"
}
主要字段:
message.records[]
和time
字段相同的containerID
连接起来)Elasticsearch具有实验性的Azure模块,这是logstash的源代码/过滤器:
我不需要这么复杂。
我想我需要:
message.records
和message.records[].time
字段的所有message.records[].properties.containerID
并串联message.records[].properties.log
字段有人可以帮忙吗?
谢谢
编辑:它认为我也必须考虑这一点: https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html ,尽管在单个事件中所有多行日志中可能有90%,但可能会将其拆分为多个事件。 另一个问题是聚合无法大规模使用(azure事件中心插件可以),因此聚合将成为瓶颈。