Skip to content

Commit

Permalink
docs(vrl): add an example of parsing upstreaminfo with parse_nginx_log
Browse files Browse the repository at this point in the history
  • Loading branch information
ex5 committed Oct 10, 2023
1 parent c9804f0 commit fb5000e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 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,31 @@ 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 - - [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] [] 10.0.0.2:9000 12123 0.049 200 752178deadbeef386279e7',
"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_upstream_name: "some-upstream-service-9000"
remote_addr: "0.0.0.0"
req_id: "752178deadbeef386279e7"
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.0.2:9000"
upstream_response_length: 12123
upstream_response_time: 0.049
upstream_status: 200
}
},
]
}

0 comments on commit fb5000e

Please sign in to comment.