-
Notifications
You must be signed in to change notification settings - Fork 6
/
logagent-config.yml
90 lines (81 loc) · 2.68 KB
/
logagent-config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Example for Logagent configuration
# Plase adjust following settings:
# input.novaSDS011.comPort
# input.gps.comPort
# input.nodejsMonitor.SPM_TOKEN
# output.mqtt.url
# output.elasticsearch.url
# output.elasticsearch.indices
options:
# suppress log event output to console
suppress: true
# Write Logagent stats in the Logagent log file /var/log/logagent.log
# The stats show how many events have been processed and shipped
# Log interval in seconds
printStats: 60
input:
novaSDS011:
module: input-nova-sda011
# Find TTY name: ls -l /dev/tty* | grep 'dialout'
comPort: /dev/ttyUSB0
# Working period in minutes. The setting is persistent
# for the connected Nova SDS011 sensor
# 1 minute measurement interval
workingPeriod: 1
gps:
module: logagent-gps
# Find TTY name: ls -l /dev/tty* | grep 'dialout'
comPort: /dev/ttyACM0
# Emit only location event, to share the location with nova sensor
emitOnlyLocationEvent: true
# disable debug output
debug: false
# Optional, monitor logagent and device performance
# Create in Sematext Cloud a Node.js monitoring app
# to obtain the SPM_TOKEN
nodejsMonitor:
module: @sematext/logagent-nodejs-monitor
SPM_TOKEN: YOUR_SEMATEXT_NODEJS_MONITORING_TOKEN
# collect all system logs for troubleshooting
files:
- /var/log/**/*.log
# calculate PM2.5/PM10 ratio in percent
outputFilter:
- module: !!js/function >
function (context, config, eventEmitter, data, callback) {
if (data.PM10 && data.PM10 > 0) {
data.PM25ratio = (data['PM2.5']/data.PM10) * 100
}
callback(null, data)
}
output:
# print log events in yaml format
# when options.suppress=false
stdout: yaml
# Forward sensor logs to MQTT broker
mqtt:
module: output-mqtt
url: mqtt://test.mosquitto.org
topic: sensor-data
debug: false
# optional filter settings matching data field with regular expressions
# we use the filter to exclude the system log files
filter:
field: logSource
match: Nova
# Store log events & sensor data in Sematext Cloud or Elasticsearch
# Create a log application in Sematext Cloud to obtain a token
elasticsearch:
module: elasticsearch
url: https://logsene-receiver.sematext.com
# url: https://logsene-receiver.eu.sematext.com
# url: http://127.0.0.1:9200
# We route system logs and sensor data to different indices
# each index has a list of regular expressions matching the logSource field
indices:
# sensor data index
YOUR_SEMATEXT_LOGS_TOKEN:
- Nova
# system logs index
ANOTHER__SEMATEXT_LOGS_TOKEN:
- var.log.*