Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi Allen,

I have tested this based on your environment setup. Version of hiera I think you would be using is hiera 1.3.4:

Hiera YAML:

---
apache::log_formats:
    extended: "%v %h %l %u %t \\\"%r\\\" %>s %b \\\"%%{FOO}{Referer}i\\\" \\\"%%{BAR}{User-Agent}i\\\""

And this gave me the following in /etc/httpd/conf/httpd.conf:

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" extended

%{FOO} and %{BAR} can be anything and used to interpret the %. This is based on HI-127. Version 2 of hiera introduced the literal() function to help with escaping.

Hi Allen,

I have tested this based on your environment setup. Version of hiera I think you would be using is hiera 1.3.4:

Hiera YAML:

---
apache::log_formats:
    extended: "%v %h %l %u %t \\\"%r\\\" %>s %b \\\"%%{FOO}{Referer}i\\\" \\\"%%{BAR}{User-Agent}i\\\""

And this gave me the following in /etc/httpd/conf/httpd.conf:

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" extended

%{FOO} and %{BAR} can be anything refer to something that doesn't exist and used to interpret the %. This is based on HI-127. Version 2 of hiera introduced the literal() function to help with escaping.