You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I remove the 2 "%"s then it works, but we need the specific string to be there as lots of log parsing program relies on the exact format to work properly. Also tried various escape characters but none can achieve what we need, some examples listed below:
1) " { \"seconds\": \"%{%s}t\" } " error: Encountered unknown tag 's'
2) ' { \"seconds\": \"%{%s}t\" } ' error: Encountered unknown tag 's'
3) ' { \"seconds\": \"%{\%s}t\" } ' no error but with incorrect result extra back slash before %s) request-log-format = { "seconds": "%{\%s}t" }
4) ' { \"seconds\": \"\%{%s}t\" } ' error: Encountered unknown tag 's'
5) " { \"seconds\": \"%{%%s}t\" } " error: tag name expected
6) " { \"seconds\": \"%%{%s}t\" } " error: tag name expected
7) '{% raw %}{ "seconds": "%{%s}t" }{% endraw %}' error: Encountered unknown tag 's'
8) !unsafe ' { "seconds": "%{%s}t" } ' error: SyntaxError: invalid syntax MODULE FAILURE
Can see the "regex_replace" part is working as the final "value_id" string has the "$" correctly changed to "%". The error message shown below is the same as before (Encountered unknown tag 's').
There is Ansible logic that tries to apply jinja2 conversions on strings - I believe that is what is causing the issue here. We got around it by converting the "%" to "\x25". Please try that.
If you run playbooks with -vvv you get detailed traces of what Ansible is doing as well as the python code that is invoked to make the REST API call to the appliance.
Test and confirmed if I changed the last line to as below, (1) replacing "%" with "\x25" and (2) enclose the whole string with single quotes (doesn't work if use double quotes),
value_id: '{ \"seconds\": \"\x25{\x25s}t\" }'
then it correctly updates the "request-log-format" key with the expected result:
request-log-format = { "seconds": "%{%s}t" }
Thanks for the help, will close the issue as resolved.
Trying to port existing settings of "request-log-format" from older version to ISAM 9. The required string is
request-log-format = { \"seconds\": \"%{%s}t\" }
But the "%{%s}t" part always caused problem in "update_reverseproxy_conf". The yml file I used is as below:
The error message is:
If I remove the 2 "%"s then it works, but we need the specific string to be there as lots of log parsing program relies on the exact format to work properly. Also tried various escape characters but none can achieve what we need, some examples listed below:
Also tried below .yml but still failed
Can see the "regex_replace" part is working as the final "value_id" string has the "$" correctly changed to "%". The error message shown below is the same as before (Encountered unknown tag 's').
Also raised a question in
stackoverflow but all of the suggestions received failed.
Plus, how do we know whether it's Ansible or ISAM or the isam-ansible-roles code that throws the error?
Please help. Thanks.
The text was updated successfully, but these errors were encountered: