#support

Issue with Extracting trace_id and span_id Using Logstash

TLDR Shivam is having trouble extracting trace_id and span_id from log bodies using Logstash and requested help. nitya-signoz suggested it could be a mapping issue and asked for more information.

Powered by Struct AI
Aug 09, 2023 (4 months ago)
Shivam
Photo of md5-dfe2ccb640343537dbb50f03db6268f1
Shivam
09:33 AM
Hi team, I have stuck in a problem .As , I am saving my logs in a file and use logstash to send logs to signoz otel collector .But , I am not able to extract trace_id and span_id through logs body as its stringify. So, I write a logstash receiver as defined in docs and also edit operator from empty array to -type: json_parser. But still , I am not able yo get traced_id and span_id. Pls help . below i attached my receiver , processor code and logstash json logs for better understanding.
Aug 10, 2023 (3 months ago)
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
04:42 AM
Hi Shivam, can you share what you see in the signoz UI ? Click on the log line and share me the json.

It’s a problem of mapping as attributes in logstash doesn’t directly match with otel attributes you will have to do some transformations, we can help you do that once you share the above.

Also any reason for sticking with logstash, is it something that you are already using with your stack ?