I'm sending log messages from a remote client to my ELK server, and all is well. The logs come in a json format, that looks something like
{
"type" => "trm-system",
"host" => "susralcent09",
"timestamp" => "2016-09-01T16:21:54.762437-04:00",
"@version" => "1",
"customer" => "cf_cim",
"role" => "app_server",
"sourcefile" => "/usr/share/tomcat/dist/logs/trm-system.log",
.........
}
In my logstash configuration files, how do I parse the value of "sourcefile" to ultimately get the filename. e.g. trm-system.log? I then want to use the result (the filename) to create the file locally in some local path.