Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Certain characters do not render correctly in message previews #859

Closed
adamdepollo opened this issue Dec 19, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@adamdepollo
Copy link

Describe the bug
Certain characters (i.e. slashes '/') do not render correctly when printed out to the Message preview in OpenSearch alert actions.

A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Generate a log with special characters in one of the log fields
  2. Write an action message template to pull in the log field value
  3. Click message preview
  4. See error

Expected behavior
Characters should render correctly in the preview.

OpenSearch Version
2.11

Dashboards Version
2.11

Plugins

AWS-managed OpenSearch

Screenshots

Screenshot 2023-12-19 at 4 07 29 PM Screenshot 2023-12-19 at 4 07 10 PM

Host/Environment (please complete the following information):

  • OS: Windows
  • Chrome Version 119.0.6045.200 (Official Build) (64-bit) and FireFox 120.0.1 64 bit
@adamdepollo adamdepollo added bug Something isn't working untriaged labels Dec 19, 2023
@manasvinibs
Copy link
Member

Hi @adamdepollo
This seems to be an error coming from the Alerting plugin create Monitor template message component.
Hi @opensearch-project/admin Can you please transfer this to alerting-dashboard-plugin to look into the error?

@gaiksaya gaiksaya transferred this issue from opensearch-project/OpenSearch-Dashboards Dec 20, 2023
@amsiglan
Copy link
Collaborator

amsiglan commented Apr 3, 2024

@adamdepollo Looking at the Mustache documentation for variables by default all the values get HTML-escaped which might be causing the / to get converted to it's encoded value. To avoid that you can use {{{_source.val}}} (notice the extra curly braces. This way the value get printed as is.

I tried this locally and it works
image
with below document's message field /var/logs

{
    "_index": "test_agg",
    "_source": {
        "request.responseStatus": 200,
        "request.remoteAddress": "us-east-1",
        "message": "/var/logs",
        "request.id": 23,
        "timestamp": "2024-04-02T23:20:00Z"
    },
    "_id": "cqUjpo4BIlTtm2adX1Ah",
    "_score": 0
}

Closing this issue since there is no code change required here. Feel free to reopen if you think it needs more work

@amsiglan amsiglan closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants