Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To push .log.gz (Application ELB) Logs to ElasticSearch #14

Open
jbontech opened this issue Feb 13, 2017 · 1 comment
Open

To push .log.gz (Application ELB) Logs to ElasticSearch #14

jbontech opened this issue Feb 13, 2017 · 1 comment

Comments

@jbontech
Copy link

Could you please give code to Push Application ELB logs ( Extention will be .log.gz) to ElasticSearch using lambda, and I try to find out in any form but no luck.
Could you please help me out to what change is necessary for this code to work with .log.gz file.
Thanks in Advance.
Regards,
JB

@jbontech jbontech changed the title To push .log.gz (Application ELB) Logs To push .log.gz (Application ELB) Logs to ElasticSearch Feb 13, 2017
@jderose9
Copy link

jderose9 commented Dec 7, 2017

To gunzip, you need to include the zlib library at the top:

const zlib = require('zlib');

Then in s3LogsToES() you need to pass the stream through to gunzip:

s3Stream
      .pipe(zlib.createGunzip())
      .pipe(lineStream)
      .pipe(recordStream)
      .on('data', function(parsedEntry) {
            postDocumentToES(parsedEntry, context);
      });

You will then need to replace the parser with your own or something like:
https://github.com/igtm/node-alb-log-parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants