GithubHelp home page GithubHelp logo

log2ltsv's Introduction

log2ltsv

apache and nginx access log to ltsv format

Installation

Download from https://github.com/tkuchiki/log2ltsv/releases

Usage

usage: log2ltsv [<flags>]

apache and nginx access log to ltsv format

Flags:
  --help            Show context-sensitive help (also try --help-long and --help-man).
  --format="nginx"  access log format (apache or nginx)
  --file=FILE       access log
  --version         Show application version.

Example

Apache

- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T" combined
$ cat logs/apache.access.log
127.0.0.1 - - [03/Sep/2017:12:23:39 +0000] "GET / HTTP/1.1" 403 3839 "-" "curl/7.47.1" 1
$ cat logs/apache.access.log | ./log2ltsv --format apache
user:- 	time:2017-09-03T12:23:39+00:00	method:GET	uri:/	status:403	size:3839	reqtime:1	apptime:1

Nginx

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
-                  '"$http_user_agent" "$http_x_forwarded_for"';
+                  '"$http_user_agent" "$http_x_forwarded_for" '
+                  '$request_time $upstream_response_time';
$ cat logs/nginx.access.log
127.0.0.1 - - [03/Sep/2017:12:21:17 +0000] "GET / HTTP/1.1" 200 3770 "-" "curl/7.47.1" "-" 0.0 0.1
$ cat logs/nginx.access.log | ./log2ltsv
user:-	time:2017-09-03T12:21:17+00:00	method:GET	uri:/	status:200	size:3770	reqtime:0.0	apptime:0.1

log2ltsv's People

Contributors

tkuchiki avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.