I am trying to configure logstash to parse out a field from the event and use it as timestamp.
My input looks like that:
<Mar 1, 2016 1:54:15 PM IST> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Mar 1, 2016 1:54:15 PM IST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Mar 1, 2016 1:54:15 PM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.31-b07 from Oracle Corporation.>
<Mar 1, 2016 1:54:16 PM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.1.3.0.0 Wed May 21 18:53:34 PDT 2014 1604337 >
<Mar 1, 2016 1:54:16 PM IST> <Warning> <Management> <BEA-141274> <Production mode has been specified at the command line using the the weblogic.ProductionModeEnabled system property. This system property overrides the development mode setting contained in the config.xml file. However, the Administration Console and WLST show the attribute values and defaults that correspond to the develo
I am trying to get the Mar 1, 2016 1:54:15 PM IST which is represent by%{WEBLOGICTIMESTAMP} %{WORD} in the grok, as the timestamp. In this way I will have in the timestamp exactly the time the message occurs and not when it was load to elasticsearch.
Please edit your post and mark your example log entry as preformatted text (there's a toolbar button for it). If you look at what you actually posted you'll note that it's not the same as what's in your log.
So what happens? Is the grok filter failing, leaving you with a _grokparsefailure tag to each event?
The grok filter isn't failing, but I am getting as timestamp the time when the doc inserted to elastic. It affects my results in monitoring.
You're not capturing the timestamp into a field. Change %{WEBLOGICTIMESTAMP} to %{WEBLOGICTIMESTAMP:timestamp}. If it still doesn't work, look in your logs for clues. If the date filter fails it'll indicate why.
It looks much better now. I have a field named timestamp and the data is there. but I have a t next to it and not a 'clock' like next to @timestamp. It means that the field is understood as a term and not as a timestamp. Right? I want to use that field as timestamp for my X axis line.
You need to include "aa" at the end of you date pattern to recognize AM or PM. Also, change HH for the hours to hh since the timestamp has 12-hour days. I'd expect "MMM dd, yyyy hh:mm:ss aa" to work.
Anyway, I also can't find logs in my logstash log directory. I assume something wrong in my configuration.
The location of the Logstash logs depends on how you invoke Logstash.
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.