Is there any way to populate this from raw logs? O...
# support
t
Is there any way to populate this from raw logs? Our logs are structued JSON and there is a
body.service
field that I would like to use for this, but it doesn't seem to be possible (I tried with pipelines but it seems that's not what they are for)
g
Hi Tomas. I have responded to another guy here and maybe it can help you. You can tag you data with a variety of info from the collector config. Hope this is what you are looking for or at least help you to find a way https://signoz-community.slack.com/archives/C01HWQ1R0BC/p1749024048312919?thread_ts=1748948913.165309&cid=C01HWQ1R0BC
t
Thanks, I want this tagging to depend on the value of
body.service
, or if not at least on the
k8s.job.name
. Is that possible at all? I have a single centralised collector where all data is sent to, not a collector per deployment.
g
I have another processors that use "if" statement that look like this :
Copy code
transform/http_code:
    metric_statements:
      - context: datapoint
        statements:
          - set(attributes["health_score"], 3) where attributes["http.status_code"] == 200
          - set(attributes["health_score"], 2) where attributes["http.status_code"] >= 300 and attributes["http.status_code"] < 500
          - set(attributes["health_score"], 1) where attributes["http.status_code"] >= 500
maybe you can set depending of the value of body.service.
t
That might work! So to show up in the left pane in Signoz under "Service name", it would have to be something like
set(resource["service.name"], attributes["body.service"])
? As in the signoz docs it says that for that area of the left pane: > Maps to
resource[service.name]
opentelemetry resource attribute. https://signoz.io/docs/logs-management/features/logs-quick-filters/#service-name
also I want to do this for logs not metrics, if it's any different
g
You have to check for your own case. I but I can filter with differents variables like that