struct tm timestamp_tm;
char timestamp_str[64];
const unsigned char *buf;
- time_t tt;
#if HAVE_YAJL_V2
size_t len;
#else
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
}
if (fh == NULL) {
- char errbuf[1024];
fprintf(stderr, "log_logstash plugin: fopen (%s) failed: %s\n", log_file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ STRERRNO);
} else {
fprintf(fh, "%s\n", buf);
if (do_close) {
if (g == NULL) {
fprintf(stderr, "Could not allocate JSON generator.\n");
- return (0);
+ return 0;
}
if (yajl_gen_map_open(g) != yajl_gen_status_ok)
}
log_logstash_print(g, LOG_INFO, (n->time != 0) ? n->time : cdtime());
- return (0);
+ return 0;
err:
yajl_gen_free(g);
fprintf(stderr, "Could not correctly generate JSON notification\n");
- return (0);
+ return 0;
} /* int log_logstash_notification */
void module_register(void) {
plugin_register_notification("log_logstash", log_logstash_notification,
/* user_data = */ NULL);
} /* void module_register (void) */
-
-/* vim: set sw=4 ts=4 tw=78 noexpandtab : */