Skip to content

Instantly share code, notes, and snippets.

@burnsie7
Created August 10, 2018 21:52
Show Gist options
  • Save burnsie7/7042a22112f212b0076d4367fa76c646 to your computer and use it in GitHub Desktop.
Save burnsie7/7042a22112f212b0076d4367fa76c646 to your computer and use it in GitHub Desktop.
Multiline Log and Test Config
mkdir /etc/datadog-agent/conf.d/logtest.d
touch /etc/datadog-agent/conf.d/logtest.d/conf.yaml
##Log section
logs:
- type: file
path: /home/vagrant/logout.log
service: cawa-server
source: cawa
tags: env:dev
log_processing_rules:
- type: multi_line
name: new_log_start_with_date
pattern: \d{8}\s+\d{2}:\d{2}:\d{2}\.\d{3}
### write_multiline
#!/bin/bash
echo "20180810 14:01:00.831 [essential] [INFO] DM.Appl.TEST_MONITORING.20432:" >> logout.log
echo "Total Messages processed for TEST_MONITORING.20432 was 5" >> logout.log
echo "Building time was 0.34 seconds" >> logout.log
echo "Processing time was 0.154 seconds" >> logout.log
echo " 39.61% Processing Handling time was 0.61 seconds" >> logout.log
echo " 9.74% Processing Publishing time was 0.15 seconds" >> logout.log
echo " Database Access time was 0.154 seconds" >> logout.log
echo " Wob Add Count: 5 Wob Update Count: 18" >> logout.log
echo "Waiting time was 59.230 seconds" >> logout.log
echo "Average processing time per Message was 30 milliseconds" >> logout.log
echo "Total Application Lifetime for TEST_MONITORING.20432 was 59.418 seconds" >> logout.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment