Replies: 1 comment 2 replies
-
Hi @Giampearo, what's your source? How do you decode the bytes as they come in to Vector? It seems like you are dealing with a valid JSON array which should be decoded first and then you can call |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
{ "severity": "ERR (!!)", "source": "GOTREQ-CreateCharge", "header": { "timestamp": "2025-01-24T09:16:11Z" }, "body": { "orderid": "1234567890", "customername": "JOHN DOE", "orderstatus": "2", "orderstatusdesc": "Pending Inventory", "email": "example@email.com", "callbackinforar": "0", "callbackinforoms": "1", "faid": "9876543210", "baid": "123456789", "dealercode": "A1234.56789", "submissiondate": "20250124171404", "paymentItems": [ { "serviceid": "60123456789", "price": "0.0", "articleid": "100016933001", "uomid": "2AD", "discountid": "", "discountamount": "", "prepostind": "POSTPAID", "accountcatdesc": "C", "marketcodedesc": "H", "itemno": "3491715875", "itemtaxgroupid": "0", "taxamount": "0", "taxpercentage": "0", "billinginvoiceno": "", "custSegment": null }, { "serviceid": "60123456789", "price": "0.0", "articleid": "80000826", "uomid": "EA", "discountid": "", "discountamount": "", "prepostind": "POSTPAID", "accountcatdesc": "C", "marketcodedesc": "H", "itemno": "3491715874", "itemtaxgroupid": "0", "taxamount": "0", "taxpercentage": "0", "billinginvoiceno": "", "custSegment": null } ] } }
The actual logs contain multiple entries, making it hard to extract and structure the data properly.
Below is an example of how the logs appear in the system:
[ { "_index": "createcharge_log_info-2025.01.24", "_type": "createcharge_log_info_type", "_id": "createcharge_log_info-2025.01.24+2+1234567", "_score": 2.0, "_source": { "environment": "Production", "messagesource": "CreateCharge", "logdatetime": "2025-01-24T09:16:11.9655377Z", "message": "Log Message", "parameters": "ERR (!!): Src:GOTREQ-CreateCharge Msg:{...} Ref:" } }, { "_index": "createcharge_log_info-2025.01.24", "_type": "createcharge_log_info_type", "_id": "createcharge_log_info-2025.01.24+0+9876543", "_score": 2.0, "_source": { "environment": "Production", "messagesource": "CreateCharge", "logdatetime": "2025-01-24T09:21:20.379127Z", "message": "Log Message", "parameters": "ERR (!!): Src:ProcessingService>>ProcessHandler Msg:Start proceed create charge handle for order: 9876543210 Ref:" } } ]
a. How can I modify my Vector.toml config to correctly process multi-line logs?
The logs appear as nested JSON inside the parameters field, making it tricky to extract and structure properly.
Efficient Parsing for Multiple Entries:
b. How can I ensure that each log entry is processed individually without losing its structure?
Best Approach for Structured Fields:
c. Are there any alternative methods or regex optimizations that could improve field extraction in Vector?
Any help or insights would be greatly appreciated! Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions