Skip to content

Commit 30dadb6

Browse files
fix(azure): normalize host field (#662)
It seems that Azure EventHub sends host information as "Host". This doesn't comply with Datadog's conventions so the host is not show in the log explorer. This detects if the Host field exists and adds the lower case host variant. --------- Co-authored-by: Ava Silver <ava.silver@datadoghq.com>
1 parent aab4546 commit 30dadb6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

azure/activity_logs_monitoring/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
var https = require('https');
77

8-
const VERSION = '1.0.1';
8+
const VERSION = '1.0.2';
99

1010
const STRING = 'string'; // example: 'some message'
1111
const STRING_ARRAY = 'string-array'; // example: ['one message', 'two message', ...]
@@ -311,6 +311,10 @@ class EventhubLogHandler {
311311
formatLog(messageType, record) {
312312
if (messageType == JSON_TYPE) {
313313
var originalRecord = this.addTagsToJsonLog(record);
314+
// normalize the host field. Azure EventHub sends it as "Host".
315+
if (originalRecord.Host) {
316+
originalRecord.host = originalRecord.Host;
317+
}
314318
var source = originalRecord['ddsource'];
315319
var config = this.logSplittingConfig[source];
316320
if (config !== undefined) {

0 commit comments

Comments
 (0)