Tuesday, April 30, 2019

Cloud Foundry router logs format

If you need to parse Cloud Foundry router logs like this:

2018-06-12T16:04:00.92+0300 [RTR/5] OUT abacus-usage-collector-1.cf.com - [2018-06-12T13:04:00.719+0000] "GET /healthcheck HTTP/1.1" 200 0 16 "-" "-" "-" "10.0.73.146:61163" x_forwarded_for:"-" x_forwarded_proto:"https" vcap_request_id:"d7aa3a8f-ff20-48c4-4a20-cb7f3f1de808" response_time:0.20847815 app_id:"71321d59-bd06-41d6-becd-7e702a6aa59b" app_index:"0" x_b3_traceid:"b7bb54f29b40de64" x_b3_spanid:"b7bb54f29b40de64" x_b3_parentspanid:"-"

Perhaps this definition from deprecated parser on GitHub will help:
{ 'msg' => '%{HOSTNAME:hostname} - \[(?<time>%{MONTHDAY}/%{MONTHNUM}/%{YEAR}:%{TIME} %{INT})\] \"%{WORD:verb} %{URIPATHPARAM:path} %{PROG:http_spec}\" %{BASE10NUM:status:int} %{BASE10NUM:request_bytes_received:int} %{BASE10NUM:body_bytes_sent:int} \"%{GREEDYDATA:referer}\" \"%{GREEDYDATA:http_user_agent}\" %{HOSTPORT} x_forwarded_for:\"%{GREEDYDATA:x_forwarded_for}\" x_forwarded_proto:\"%{GREEDYDATA:x_forwarded_proto}\" vcap_request_id:%{NOTSPACE:vcap_request_id} response_time:%{NUMBER:response_time:float} app_id:%{NOTSPACE}' }

No comments:

id_rsa.pub: invalid format, error in libcrypto

After I upgraded my Linux and got Python 3.10 by default, it turned out that Ansible 2.9 will no longer run and is unsupported together with...