Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4720

Numeric variables default to -

$
0
0

Hi,

I’m trying to log as json, starting from GitHub - salimchehab/terraform-aws-haproxy-cloudwatch-log-format-json: Setup CloudWatch Log Groups and Metric Filters for HAProxy logs (adjusted to JSON output format). with friendlier variable names.
These sequences:
“backend”:{“name”:"%b",“beconn”:%bc,“source_ip”:"%bi",“source_port”:%bp,“queue”:%bq}
“server”:{“name”:"%s",“srv_conn”:%sc,“ip”:"%si",“port”:%sp,“queue”:%sq}
for example, will produce something like this:
“backend”:{“name”:“emea-dfv4”,“beconn”:0,“source_ip”:"-",“source_port”:-,“queue”:0},
“server”:{“name”:"",“srv_conn”:0,“ip”:"-",“port”:-,“queue”:0}
if a DENY rule is matched (termination state PR–). This is not valid json, specifically these two:
“source_port”:-
“port”:-
Now %bp and %sp are supposed to be numeric, so they should default to a number, like -1, or the - should be quoted.
Not sure if that’s something achievable with a smart log-format pattern, or a little improvement is needed in the source code.

Thanks,
Victor

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>