JSON_CONF_FILENAME = 0,
JSON_CONF_SYNC,
JSON_CONF_TIMESTAMP,
+ JSON_CONF_EVENTV1,
JSON_CONF_DEVICE,
JSON_CONF_BOOLEAN_LABEL,
JSON_CONF_MAX
.options = CONFIG_OPT_NONE,
.u = { .value = 1 },
},
+ [JSON_CONF_EVENTV1] = {
+ .key = "eventv1",
+ .type = CONFIG_TYPE_INT,
+ .options = CONFIG_OPT_NONE,
+ .u = { .value = 0 },
+ },
[JSON_CONF_DEVICE] = {
.key = "device",
.type = CONFIG_TYPE_STRING,
return ULOGD_IRET_ERR;
}
+ if (upi->config_kset->ces[JSON_CONF_EVENTV1].u.value != 0)
+ json_object_set_new(msg, "@version", json_integer(1));
+
if (upi->config_kset->ces[JSON_CONF_TIMESTAMP].u.value != 0) {
time_t now;
char timestr[MAX_LOCAL_TIME_STRING];
t->tm_min, t->tm_sec);
}
- json_object_set_new(msg, "timestamp", json_string(timestr));
+ if (upi->config_kset->ces[JSON_CONF_EVENTV1].u.value != 0)
+ json_object_set_new(msg, "@timestamp", json_string(timestr));
+ else
+ json_object_set_new(msg, "timestamp", json_string(timestr));
}
if (upi->config_kset->ces[JSON_CONF_DEVICE].u.string) {
# by the input plugin is coding the action on packet: if 0, then
# packet has been blocked and if non null it has been accepted.
#boolean_label=1
+# Uncomment the following line to use JSON v1 event format that
+# can provide better compatility with some JSON file reader.
+#eventv1=1
[pcap1]
#default file is /var/log/ulogd.pcap