X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flog_logstash.c;h=24083a5081e1445d78d61002f3b111fdd0c14020;hb=0a8741b9061f8df4a78a448c021612db06e17425;hp=2d5f6203802852b0bf7174eaf0ab8c22bdf237a9;hpb=aedf67e69cbe93a6925fd1004a7c8b990aed4b0a;p=collectd.git diff --git a/src/log_logstash.c b/src/log_logstash.c index 2d5f6203..24083a50 100644 --- a/src/log_logstash.c +++ b/src/log_logstash.c @@ -27,11 +27,11 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include -#include #include #include #if HAVE_YAJL_YAJL_VERSION_H @@ -65,12 +65,12 @@ static int log_logstash_config (const char *key, const char *value) if (0 == strcasecmp (key, "LogLevel")) { log_level = parse_log_severity(value); - if (log_level < 0) { - log_level = LOG_INFO; - ERROR("log_logstash: invalid loglevel [%s] defaulting to 'info'", - value); - return 1; - } + if (log_level < 0) { + log_level = LOG_INFO; + ERROR("log_logstash: invalid loglevel [%s] defaulting to 'info'", + value); + return 1; + } } else if (0 == strcasecmp (key, "File")) { sfree (log_file); @@ -90,7 +90,6 @@ static void log_logstash_print (yajl_gen g, int severity, struct tm timestamp_tm; char timestamp_str[64]; const unsigned char *buf; - time_t tt; #if HAVE_YAJL_V2 size_t len; #else @@ -140,8 +139,7 @@ static void log_logstash_print (yajl_gen g, int severity, yajl_gen_status_ok) goto err; - tt = CDTIME_T_TO_TIME_T (timestamp_time); - gmtime_r (&tt, ×tamp_tm); + gmtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), ×tamp_tm); /* * format time as a UTC ISO 8601 compliant string