Created
July 26, 2018 16:07
-
-
Save millzpaugh/dcb5d99d04284c310fc2ce2f21d2cde6 to your computer and use it in GitHub Desktop.
parses aws elb logs to filter out non-composite requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let count = 0; | |
fs.readFileSync('./07-11-log-pull.log').toString().split('\n').forEach(function (l) { | |
try{ | |
const tsvFile = /(?<=GET).*$/; | |
const d = tsvFile.exec(l); | |
if (d) { | |
const v = d[0].split(' ')[1].split('/')[4]; | |
const mapidCount = v ? v.split(',').length : 0; | |
if (mapidCount > 1){ | |
count+=1; | |
console.log('count!', count); | |
fs.appendFileSync("./07-11-composite-requests.log", l + "\n"); | |
} | |
} | |
} catch(e){ | |
console.log('ERROR', e); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment