fix(*): Make the elasticsearch logging render out log data correctly for filtering in kibana

This commit is contained in:
2021-02-14 19:13:29 +00:00
parent 939a99b62d
commit c3fcc15f06
2 changed files with 9 additions and 5 deletions
+4 -1
View File
@@ -2,7 +2,10 @@
"channeldeletetimeinminutes": 30,
"deletecommandstoggle": false,
"maxqueuesize": 4,
"elasticsearchhost": "http://YOUR-ELASTICSEARCH-ADDRESS-GOES-HERE:9200",
"elasticsearch" : {
"elasticsearch_address" : "http://YOUR-ELASTICSEARCH-ADDRESS-GOES-HERE:9200",
"elasticsearch_index_pattern" : "[logs-denbot-]YYYY.MM.DD"
},
"prefix": "!",
"token": "YOUR-TOKEN-GOES-HERE"
}
+5 -4
View File
@@ -11,16 +11,17 @@ if (process.env.NODE_ENV === 'production') {
const esTransportOpts = {
level: 'error',
indexPrefix: 'logs_denbot',
clientOpts: {
host: config.elasticsearchhost,
host: config.elasticsearch.elasticsearch_address,
log: 'error'
},
transformer: logData => {
return {
"@timestamp": (new Date()).getTime(),
timestamp: new Date().toISOString(),
severity: logData.level,
message: `${getCurrentDateAndTime()} - ${logData.message}`,
fields: {
message: logData.message,
meta: {
app: 'denBot',
env: env
}