[GH-ISSUE #315] Feature Request: Upload/Attach a small log file #238

Closed
opened 2026-02-25 23:41:44 +03:00 by kerem · 1 comment
Owner

Originally created by @skycrash on GitHub (Dec 21, 2019).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/315

can upload/attach a log file from my cron routine, inform if was error or something else

Originally created by @skycrash on GitHub (Dec 21, 2019). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/315 can upload/attach a log file from my cron routine, inform if was error or something else
kerem closed this issue 2026-02-25 23:41:44 +03:00
Author
Owner

@cuu508 commented on GitHub (Jan 7, 2020):

This is already sort of possible: you can make HTTP POST requests to the ping URLs and include arbitrary content in the request body.

Healthchecks stores first 10KB of the request body, so small JSON documents or logfile fragments would work.

Here's an example (not mine, sent in by an user):

m=$(/usr/bin/certbot renew 2>&1); curl -fsS -X POST --data-raw "$(echo "$m" | tail -c 10000)" "https://hc-ping.com/UUID$([ $? -ne 0 ] && echo -n /fail)" >/dev/null

It runs certbot and saves output in the $m variable. It then makes a HTTP POST request with the output in request body. As a bonus, it adds /fail to the ping URL if the certbot command returned non-zero exit code.

This could be simplified (or extended...) depending on your needs.

<!-- gh-comment-id:571571749 --> @cuu508 commented on GitHub (Jan 7, 2020): This is already sort of possible: you can make HTTP POST requests to the ping URLs and include arbitrary content in the request body. Healthchecks stores first 10KB of the request body, so small JSON documents or logfile fragments would work. Here's an example (not mine, sent in by an user): m=$(/usr/bin/certbot renew 2>&1); curl -fsS -X POST --data-raw "$(echo "$m" | tail -c 10000)" "https://hc-ping.com/UUID$([ $? -ne 0 ] && echo -n /fail)" >/dev/null It runs certbot and saves output in the $m variable. It then makes a HTTP POST request with the output in request body. As a bonus, it adds `/fail` to the ping URL if the certbot command returned non-zero exit code. This could be simplified (or extended...) depending on your needs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#238
No description provided.