Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

add bash exemple to push logs on ovh LDP #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/bash/apk.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ca-certificates
openssl
4 changes: 4 additions & 0 deletions examples/bash/functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
functions:
hello:
runtime: bash
handler: log_test.hello
7 changes: 7 additions & 0 deletions examples/bash/log_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function hello() {
>&2 echo "$1"

declare log_token=$1
echo -e '{"version":"1.1", "host": "example.org", "short_message": "A short GELF message that helps you identify what is going on '$(hostname)'", "full_message": "Backtrace here more stuff", "timestamp": '$(date +'%s')', "level": 1, "_user_id": 9001, "_some_info": "foo", "some_metric_num": 42.0, "_X-OVH-TOKEN":"'$log_token'"}\0' | openssl s_client -quiet -no_ign_eof -connect discover.logs.ovh.com:12202
return 0
}