Hello team,
I am unbale to convert field into data type. Can you please help me on this. Format is coming as Text only
Sample Log:
CIG,CCI05_05_NRW_22102020043728_000014635.txt,26/07/2022 04:37:50,26/07/2022 04:42:12,CCI05_05_NRW_22102020043728_000014635.txt,26-07-2022 03:00,26-07-2022 04:42,CCI05_05_NRW_22102020043728_000014635.txt,04:42:33,,,SENT_FROM_BPM,,,,,
GROK:
%{GREEDYDATA},\s*%{DATE:date1}\s*%{TIME:time1}\,\s*%{DATE:date2}\s*%{TIME:time2}
Logstash Conf:
input {
beats {
port => 5044
}
}
filter {
grok {
match => { "message" => "%{GREEDYDATA},\s*%{DATE:date1}\s*%{TIME:time1}\,\s*%{DATE:date2}\s*%{TIME:time2}"
}
}
mutate {
add_field => {
"Source_Creation_Date" => "%{date1} %{time1}"
"Source_updation_Date" => "%{date2} %{time2}"
}
}
date {
match => [ "Source_Creation_Date", "dd/MM/yyyy HH:mm:ss", "dd/MM/yyyy HH:mm:ss" ]
}
date {
match => [ "Source_updation_Date", "dd/MM/yyyy HH:mm:ss", "dd/MM/yyyy HH:mm:ss" ]
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "testindexdata6"
}
stdout { codec => rubydebug }
}