hello everyone !
So I'm struggling with aggregation in logstash. Here is my problem:
I have an API platform that log all the call and when a call is made it generate 3 or 4 row of log. I'd like to aggregate those multiple log entry into one "big" record that contain all what I want.
Here is an example of a log record:
{
"timestamp": 1556787558121,
"correlationId": "66b1ca5c604be39706af29e7",
"processInfo": {
"hostname": "a98sv068",
"domainId": "3c03047f-74bb-48a0-a625-a7fa4f04ef9e",
"groupId": "group-10",
"groupName": "ManagerLan",
"serviceId": "instance-77",
"serviceName": "ManagerLan",
"version": "v7.5.3-Internal"
},
"transactionElement": {
"leg": 1,
"duration": 12,
"serviceName": "SA_Toolbox_API_UAT",
"operation": "getClientApplicationLogo",
"finalStatus": null,
"protocolInfo": {
"http": {
"uri": "/applications/18101/logo",
"status": 200,
"statusText": "",
"method": "GET",
"vhost": null,
"wafStatus": 0,
"bytesSent": 1948,
"bytesReceived": 915,
"remoteName": "api.toolbox.SA.com",
"remoteAddr": "10.16.65.14",
"localAddr": "10.15.41.1",
"remotePort": "443",
"localPort": "45840",
"sslSubject": "/C=FR/ST=Hauts-de-Seine/L=Courbevoie/CN=toolbox.SA.com",
"authSubjectId": "Pass Through"
},
"recvHeader": "HTTP\/1.1 200 \r\nCache-Control: max-age=7200, private\r\nX-
Content-Type-Options: nosniff\r\nX-XSS-Protection: MT\r\nConnection:
close\r\n\r\n",
"sentHeader": "GET \/applications\/18101\/logo HTTP\/1.1\r\nHost: api.toolbox.SA.com\r\nMax-Forwarfr-FR\r\"",
" recvPayload ": null,
" sentPayload ": null
}
}
}
--
{
" timestamp ": 1556787558134,
" correlationId ": " 66b1ca5c604be39706af29e7 ",
" processInfo ": {
" hostname ": " a98sv068 ",
" domainId ": " 3c03047f - 74bb - 48a0 - a625 - a7fa4f04ef9e ",
" groupId ": " group - 10 ",
" groupName ": " ManagerLan ",
" serviceId ": " instance - 77 ",
" serviceName ": " ManagerLan ",
" version ": " v7.5.3 - Internal "
},
" circuitPath ": [{
" policy ": " API Broker ",
" execTime ": 19,
" filters ": [{
" name ": " Set service context ",
" type ": " ApiServiceContextFilter ",
" class ": " com.vordel.coreapireg.runtime.broker.ApiServiceContextFilter ",
" status ": " Pass ",
" filterTime ": 1556787558114,
" execTime ": 0
}, {
" name ": " Connect to URL ",
" type ": " VApiConnectToURLFilter ",
" class ": " com.vordel.circuit.vapi.VApiConnectToURLFilter ",
" status ": " Pass ",
" filterTime ": 1556787558133,
" execTime ": 19
}
]
}
]
}
--
{
" timestamp ": 1556787558134,
" correlationId ": " 66b1ca5c604be39706af29e7 ",
" processInfo ": {
" hostname ": " a98sv068 ",
" domainId ": " 3c03047f - 74bb - 48a0 - a625 - a7fa4f04ef9e ",
" groupId ": " group - 10 ",
" groupName ": " ManagerLan ",
" serviceId ": " instance - 77 ",
" serviceName ": " ManagerLan ",
" version ": " v7.5.3 - Internal "
},
" transactionSummary ": {
" path ": " / SA / toolbox / applications / {
id
}
/logo",
"protocol": "https",
"protocolSrc": "8065",
"status": "success",
"serviceContexts": [{
"service": "SA_Toolbox_API_UAT",
"monitor": true,
"client": "Pass Through",
"org": null,
"app": null,
"method": "getClientApplicationLogo",
"status": "success",
"duration": 20
}
]
}
}
--
{
"timestamp": 1556787558113,
"correlationId": "66b1ca5c604be39706af29e7",
"processInfo": {
"hostname": "a98sv068",
"domainId": "3c03047f-74bb-48a0-a625-a7fa4f04ef9e",
"groupId": "group-10",
"groupName": "ManagerLan",
"serviceId": "instance-77",
"serviceName": "ManagerLan",
"version": "v7.5.3-Internal"
},
"transactionElement": {
"leg": 0,
"duration": 21,
"serviceName": "SA_Toolbox_API_UAT",
"operation": "getClientApplicationLogo",
"finalStatus": "Pass",
"protocolInfo": {
"http": {
"uri": "/SA / toolbox / applications / 18101 / logo ",
" status ": 200,
" statusText ": " ",
" method ": " GET ",
" vhost ": null,
" wafStatus ": 0,
" bytesSent ": 987,
" bytesReceived ": 1914,
" remoteName ": " 127.0.0.1 ",
" remoteAddr ": " 127.0.0.1 ",
" localAddr ": " 127.0.0.1 ",
" remotePort ": " 60719 ",
" localPort ": " 8066 ",
" sslSubject ": null,
" authSubjectId ": " Pass Through "
},
" recvHeader ": " GET \ / SA \ / toos: 20 \ r \ nVia: 1.1 a98sv068()AAAvjucYgm\/\n",
"sentHeader": "HTTP\/1.=block\r\nContent-Type: image\/png\r\n\r\n",
"recvPayload": null,
"sentPayload": null
}
}
}
Of course this log has been changed
So my goal is to create a record with
4 big parts
-
obviously the common part:
"correlationId": "66b1ca5c604be39706af29e7", "processInfo": { "hostname": "a98sv068", "domainId": "3c03047f-74bb-48a0-a625-a7fa4f04ef9e", "groupId": "group-10", "groupName": "ManagerLan", "serviceId": "instance-77", "serviceName": "ManagerLan", "version": "v7.5.3-Internal" }
-
the part containing the "transactionElement" information
-
the part containing the "circuitPath" information
-
the part containing the "transactionSummary" information
it look like my setting for the moment are not working well for logstash
Does someone could have an idea on how to start this in a good maner ?
thanks !