HI Tyler,
My kibana version is 6.6.2
The date field we are talking about its a date inside log message
we used grok filter which extracts the date from log message as a separate field
logstash.conf
input {
file {
path => "/home/*.log"
start_position => "beginning"
}
}
filter {
grok {
match => ["message","%{TIMESTAMP_ISO8601:date} [%{LOGLEVEL:log-level}] %{DATA:component} %{DATA:class} %{DATA:method} %{DATA:imei} %{DATA:token} %{GREEDYDATA:message}"]
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}
sample log :
2019-04-29 13:05:31:663 [INFO] DTLS-Connection-Handler-64 o.e.l.s.b.d.BootstrapRedisSecurityStoreImpl getByIdentity Params - identity:7ce2471eced27dee9f3761df8123ba15
output :
{
"method" => "getByIdentity",
"path" => "/home/logs/b.log",
"class" => "o.e.l.s.b.d.BootstrapRedisSecurityStoreImpl",
"host" => "qolsys-desktop",
"@timestamp" => 2019-04-30T11:10:02.512Z,
"tags" => [
[0] "_grokparsefailure"
],
"date" => "2019-04-29 13:05:31:663",
"message" => [
[0] "2019-04-29 13:05:31:663 [INFO] DTLS-Connection-Handler-64 o.e.l.s.b.d.BootstrapRedisSecurityStoreImpl getByIdentity Params - identity:7ce2471eced27dee9f3761df8123ba15",
[1] "Params - identity:7ce2471eced27dee9f3761df8123ba15"
],
"log-level" => "INFO",
"@version" => "1",
"component" => "DTLS-Connection-Handler-64"
}
The output shows date field now i want to write an dsl query to display all the logs for a particular range of date field
the timepicker is used to sort by logs by uploaded time so it wont be useful
in my case log generated time is in date field and log uploaded time by kibana is in @timestamp and all i want to do filter out the date field .