Skip to content

Commit

Permalink
Add -s and -S option to curl command
Browse files Browse the repository at this point in the history
* Add `-s` option to curl command to suppress progress table output (quiet mode)
* Add `-S` option to override quiet mode on error and print error output
  • Loading branch information
mbonsack authored and GitHub committed Jun 16, 2020
1 parent 644f85a commit cd1f20c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ then
HEC=$(echo '{{- getenv "SPLUNK_HEC_URL" | strings.ReplaceAll "/services/collector" "" | strings.ReplaceAll "/event" "" | regexp.ReplaceLiteral "[, ]+" "/services/collector/event " }}/services/collector/event' | gomplate | cut -d' ' -f 1)
SC4S_DEST_SPLUNK_HEC_FALLBACK_INDEX=$(cat /opt/syslog-ng/etc/conf.d/local/context/splunk_metadata.csv | grep ',index,' | grep sc4s_events | cut -d, -f 3)
export SC4S_DEST_SPLUNK_HEC_FALLBACK_INDEX
if ! curl -k "${HEC}?/index=${SC4S_DEST_SPLUNK_HEC_FALLBACK_INDEX}" -H "Authorization: Splunk ${SPLUNK_HEC_TOKEN}" -d '{"event": "HEC TEST EVENT", "sourcetype": "SC4S:PROBE"}'
if ! curl -s -S -k "${HEC}?/index=${SC4S_DEST_SPLUNK_HEC_FALLBACK_INDEX}" -H "Authorization: Splunk ${SPLUNK_HEC_TOKEN}" -d '{"event": "HEC TEST EVENT", "sourcetype": "SC4S:PROBE"}'
then
echo "SC4S_ENV_CHECK_HEC: Splunk HEC endpoint is unreachable; startup will continue to prevent data loss if this is a transient failure"
else
Expand Down

0 comments on commit cd1f20c

Please sign in to comment.