Reputation: 21
I am currently using fluentbit as a sidecar container to push the log into New Relic for services which is deployed as docker in ECS Fargate.
Currently log message looks as below: [37m[Info] 2022-12-9T09:08:15.346, isRequestSuccess: False, totalTime: 2603, category: <Category>, callerIpAddress: <IP address>, timeGenerated: 12/09/2022 09:08:15, region: QA, correlationId: fecdafdb-c6af-41ac-a653-ecabbc682392, method: GET, url: <Request URL>, backendResponseCode: 503, responseCode: 503, responseSize: 370, cache: none, backendTime: 1600, apiId: <API Id>, operationId: HealthCheck, productId: <Product Id>, clientProtocol: HTTP/1.1, backendProtocol: HTTP/1.1, apiRevision: 1, clientTlsVersion: 1.2, backendMethod: GET, backendUrl: <Bakend URL>, correlationId: fecdafdb-c6af-41ac-a653-ecabbc682392[0m
Its logged as a unstrcutured data and I cannot use new relic query on the specific field in the log as unstructured data.
FluentBit with following configuration:
[OUTPUT]
name nrlogs
match *
license_key <license-key>
base_uri <host>
Does anyone know how to push the logs to new relic in structured way? I have tried with few new relic parsers and that did not help me.
Any help is appreciated.
Upvotes: 0
Views: 486
Reputation: 61
I'd recommend one of the following approaches:
aparse(..)
or capture(..)
to extract the relevant fields at query time. (See: https://newrelic.com/blog/how-to-relic/nrql-improvements and https://newrelic.com/blog/how-to-relic/using-regex-capture)I hope this helps!
Upvotes: 1