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

docs(vrl): add an example of parsing upstreaminfo with parse_nginx_log #18815

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Changes from 2 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
28 changes: 28 additions & 0 deletions website/cue/reference/remap/functions/parse_nginx_log.cue
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,33 @@ remap: functions: parse_nginx_log: {
host: "localhost:8081"
}
},
{
title: "Parse via Nginx log format (ingress_upstreaminfo)"
source: #"""
parse_nginx_log!(
s'0.0.0.0 - bob [18/Mar/2023:15:00:00 +0000] "GET /some/path HTTP/2.0" 200 12312 "https://10.0.0.1/some/referer" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" 462 0.050 [some-upstream-service-9000] [some-other-upstream-5000] 10.0.50.80:9000 19437 0.049 200 752178adb17130b291aefd8c386279e7',
"ingress_upstreaminfo"
)
"""#
return: {
body_bytes_size: 12312
http_referer: "https://10.0.0.1/some/referer"
http_user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
proxy_alternative_upstream_name: "some-other-upstream-5000"
proxy_upstream_name: "some-upstream-service-9000"
remote_addr: "0.0.0.0"
remote_user: "bob"
req_id: "752178adb17130b291aefd8c386279e7"
request: "GET /some/path HTTP/2.0"
request_length: 462
request_time: 0.050
status: 200
timestamp: "2023-03-18T15:00:00Z"
upstream_addr: "10.0.50.80:9000"
upstream_response_length: 19437
upstream_response_time: 0.049
upstream_status: 200
}
},
]
}