Invalid args in converter 'map' : The file "/etc/haproxy/extensions.map" is already used as one column file and cannot be used by as two column file

Hi everyone,

I got the error indicated in the title after trying to use map to convert a chrome extension ID to a nice name in my haproxy logs.

The line where I placed the map argument is the following:

log-format “%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %{+Q}r %[var(txn.endpoint)] %[var(txn.tier)] %[capture.req.hdr(1)] %[var(txn.origin),map(/etc/haproxy/extensions.map] %[capture.req.hdr(0)]”

And the content of my extensions.map file is the following:

chrome-extension://bfnaelmomeimhlpmgjnjophhpkkoljpa phantom_chrome_extension

If that’s of any help, below you can also see the line where I set the variable “txn.origin”:

http-request set-var(txn.origin) req.hdr(Origin) if has_origin

I was wondering why this error? It indicates the file cannot be used by as two column file, but that’s not the case right? This is a map file, could it be interpreting it wrongly somehow?

I have also tried to put this map in the variable itself, but I had the same error, below is what I’ve tried:

acl is_chrome_extension req.hdr(Origin) -m str -f /etc/haproxy/extensions.map
http-request set-var(txn.origin) req.hdr(Origin) if has_origin !is_chrome_extension
http-request set-var(txn.origin) req.hdr(Origin),map(/etc/haproxy/extensions.map) if has_origin is_chrome_extension

Do you guys have any idea of what I could be doing wrong here?

Thank you beforehand!