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

How to properly display output in desired format to telegram? #686

Closed
H4nT0x111 opened this issue May 7, 2024 · 2 comments
Closed

How to properly display output in desired format to telegram? #686

H4nT0x111 opened this issue May 7, 2024 · 2 comments

Comments

@H4nT0x111
Copy link

H4nT0x111 commented May 7, 2024

Hi, I'm trying to push an alert from an external system => webhook server => telegram. But now I'm having the following problem:
The output information is not as I expected, specifically this is webhook.json
2024-05-07_15h49_03
webhook-endpoint.sh
2024-05-07_15h50_39
I tried to test with Postman, this is request body
2024-05-07_15h52_08
and the result on Telegram app
image
As you can see, the output content displays the {"text":......} part but I only want to display the body of that response (just the value of the key text). When I try with just plain text, it shows the error error parsing body payload due to unsupported content type header: text/plain and the output on telegram only shows null like this.
image
Do you have any way to resolve this problem? Please help me to fix it. Thanks

@adnanh
Copy link
Owner

adnanh commented May 13, 2024

If you want to pass the "text" property from the payload object, you need to specify it like this:

"pass-arguments-to-command": [ {"source": "payload", "name": "text" } ]

@H4nT0x111
Copy link
Author

Thanks for your answer. I did it based on your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants