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

LTSV support for decoding logs #471

Open
f1shl3gs opened this issue Jul 29, 2022 · 0 comments
Open

LTSV support for decoding logs #471

f1shl3gs opened this issue Jul 29, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@f1shl3gs
Copy link
Owner

f1shl3gs commented Jul 29, 2022

LTSV -- Labeled Tab-separated Values format is a variant of Tab separated Values(TSV).

Apach and Nginx use this kind of format for access log

# Nginx
log_format ltsv "time:$time_local"
                "\thost:$remote_addr"
                "\tforwardedfor:$http_x_forwarded_for"
                "\treq:$request"
                "\tstatus:$status"
                "\tsize:$body_bytes_sent"
                "\treferer:$http_referer"
                "\tua:$http_user_agent"
                "\treqtime:$request_time"
                "\tcache:$upstream_http_x_cache"
                "\truntime:$upstream_http_x_runtime"
                "\tvhost:$host";

BTW:
If nginx produce json logs, then everything is simplier and efficient. e.g.

log_format json escape=json '{"@timestamp":"$time_iso8601",'
            '"@version":"1",'
            '"server_addr":"$server_addr",'
            '"remote_addr":"$remote_addr",'
            '"host":"$host",'
            '"uri":"$uri",'
            '"body_bytes_sent":$body_bytes_sent,'
            '"bytes_sent":$body_bytes_sent,'
            '"upstream_response_time":$upstream_response_timer,'
            '"request":"$request",'
            '"request_length":$request_length,'
            '"request_time":$request_time,'
            '"status":"$status",'
            '"http_referer":"$http_referer",'
            '"http_x_forwarded_for":"$http_x_forwarded_for",'
            '"http_user_agent":"$http_user_agent"'
            '}';
@f1shl3gs f1shl3gs added the enhancement New feature or request label Jul 29, 2022
@f1shl3gs f1shl3gs removed the feature label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant