Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

logging - How to Tag / Label / Filter DataDog logs

I’m trying to group logs from a source so I can filter them in or out in DataDog logs.

There is already a grok parser that formats the messages, but how can I add a tag to them?

DataDog seem to use a subset of LogStash grok parsing rules: https://docs.datadoghq.com/logs/processing/processors/

Eg from Heroku:

source=worker.1 dyno=heroku.152688202.1b2da7cb-291c-43ea-b5ee-bf9388bc5c6a 
sample#load_avg_1m=0.06 sample#load_avg_5m=0.14 sample#load_avg_15m=0.09

as

{ source { worker: 1 }...

What I'd like is to add something like a type, so I know they are not from the app, eg

{ type: 'metrics', source { worker: 1 }...

Then I guess I could add the same thing to app logs and add type: 'app' to them.

question from:https://stackoverflow.com/questions/65829133/how-to-tag-label-filter-datadog-logs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Need to use category-processor https://docs.datadoghq.com/logs/processing/processors/?tab=ui#category-processor

Example: enter image description here

I didn't do enough research before posting this question, but the answer for anyone else looking.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...