Created 11-16-2021 04:07 AM
I'm trying to use a ListenUDPRecord processor to parse syslog messages as input, using SyslogReader as Record Reader and JsonRecordSetWriter as Record Writer.
The solution is working as I am getting a json message as output with the following fields: priority, severity, facility, version, timestamp, hostname, body.
The json must then be indexed in a solr collection and the problem is that I get a timestamp field of the form: Nov 16 12:36:32 but I would need a unix timestamp fomat field (e.g. 1637062592000) or an output like that: "2021-11-16 12:36:32".
I tried to specify the "Timestamp Format" field of the JsonRecordSetWriter service (i.e. "yyyy-MM-dd HH:mm:ss" or "MM/dd/yyyy HH:mm:ss") but output does not change.
How can I change the structure of the timestamp field of my output json message?
Created 11-18-2021 06:45 AM
{
"type" : "record",
"name" : "nifiRecord",
"namespace" : "org.apache.nifi",
"fields" : [ {
"name" : "priority",
"type" : [ "null", "string" ]
}, {
"name" : "severity",
"type" : [ "null", "string" ]
}, {
"name" : "facility",
"type" : [ "null", "string" ]
}, {
"name" : "version",
"type" : [ "null", "string" ]
}, {
"name" : "timestamp",
"type" : [ "null", "string" ]
}, {
"name" : "hostname",
"type" : [ "null", "string" ]
}, {
"name" : "body",
"type" : [ "null", "string" ]
} ]
}If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.
Thank you,
Matt
Created 11-18-2021 06:45 AM
{
"type" : "record",
"name" : "nifiRecord",
"namespace" : "org.apache.nifi",
"fields" : [ {
"name" : "priority",
"type" : [ "null", "string" ]
}, {
"name" : "severity",
"type" : [ "null", "string" ]
}, {
"name" : "facility",
"type" : [ "null", "string" ]
}, {
"name" : "version",
"type" : [ "null", "string" ]
}, {
"name" : "timestamp",
"type" : [ "null", "string" ]
}, {
"name" : "hostname",
"type" : [ "null", "string" ]
}, {
"name" : "body",
"type" : [ "null", "string" ]
} ]
}If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.
Thank you,
Matt