Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions azure/blobs_logs_monitoring/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Copyright 2021 Datadog, Inc.

var tls = require('tls');
var zlib = require('zlib');

const VERSION = '0.2.0';

Expand Down Expand Up @@ -45,6 +46,10 @@ module.exports = function(context, blobContent) {
if (typeof blobContent === 'string') {
logs = blobContent.trim().split('\n');
} else if (Buffer.isBuffer(blobContent)) {
// Gunzip data that has magic header https://en.wikipedia.org/wiki/Gzip
if(blobContent[0]==0x1f && blobContent[1]==0x8b){
blobContent = zlib.gunzipSync(blobContent);
}
logs = blobContent
.toString('utf8')
.trim()
Expand Down