I'm new to ELK, Please help me in getting out of this issue.
I have logs having a "AdmitDate" field. @timestamp field is showing the date and time which I have uploaded the logs.The requirement is, @timestamp field must contain the date and time same as "AdmitDate" field.
For this I have changed the logstash.conf file as below:
input
{
file
{
type => "csv"
tags => "csv"
path =>["Q:/sanjay/Splunk/DB/out_hemas_test.csv"]
start_position => "beginning"
}
}
filter
{
csv
{
columns => ["AdmitDate","IPID","AdmissionNumber","PatientID","RegCode","FirstName","Middlename","PatientName","Age","Gender"]
separator => ","
}
I have logs having a "AdmitDate" field. @timestamp field is showing the date and time which I have uploaded the logs.The requirement is, @timestamp field must contain the date and time same as "AdmitDate" field.
I think the pattern is failing as 'DD' represents day of the year while 'dd' corresponds to day of the month. Try using the pattern 'YYYY-MM-dd HH:mm:ss.SSS' instead and see if that helps.
But you still have the trailing whitespace, but now I see you also have leading whitespace in the AdmitDate field. I suggest you hand-edit one line in the source file and trim the whitespace and retry. If we can confirm that it fixes the problem with can dig into the whitespace again.
Hi,
my problem solved by using the following grok command.
grok
{
match => ["AdmitDate", "%{YEAR:al_year}-%{MONTHNUM:al_month}-%{MONTHDAY:al_monthday}
}
Hi All,
I am also facing the same problem Logstash is not considering my log date rather making the date at which I am forwarding the logs as @timeStamp field.
@sanju1323 could you please help me in generating the filter as you have did for your date
currently I am using
date {
match => [ "logdate", "YYYY-MM-dd HH:mm:ss,SSS Z" ]
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.