Hello all,
I am trying to use the filebeat.yml file for the first time. Since, the logs are being logged in a different country and sometimes I see an abrupt jump in the logs visibility. It might be (not sure) because previously those services were not online for the logs to ES clusters. Anyways, I want to get only the date and time and display that as a field in kibana logs.
For the solution, I am trying the script processors as follows:
- script:
lang: javascript
id: my_filter
tag: enable
source: >
function process(event) {
var str = event.Get("event.message");
var time = str.split(" ").slice(1,3).join("@");
event.Put("event.start_time",time);
}
- timestamp:
#format the start_time layouts then assign to @timestamp
field: start_time
layouts:
-'2006-01-02@15:04:05.999'
But in Kibana, I am not seeing any field which is "start_time"
Further, It took me a lot of time to write this script and combat with for correct syntax. Since, I am going to write lot of if else
and slicing them based on condition, Any easier way to do this?