Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: myapp
name: myapp
namespace: mynamespace
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
annotations:
ad.datadoghq.com/myapp.logs: '[
{
"source": "nodejs",
"service": "myapp",
"log_processing_rules": [
{
"type": "exclude_at_match",
"name": "exclude_health_checks",
"pattern": "health"
},
{
"type": "multi_line",
"name": "log_start_with_date",
"pattern": ".*\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}.\\d{3}[-|+]\\d{4}" ### this pattern will recognize even "colored" nodejs output that cause "[32m" or/and "<0x1b>" at the begginning of the log
}
]
}
]'
labels:
app: myapp
spec:
containers:
- name: myapp
image: "myapp:latest"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment