Logstash is sending older messages. Below is my pipeline.
input {
file {
path => "C:/Program Files (x86)/dataops/ag/web/Logs/webSvr*"
type => "webSvr"
start_position => "beginning"
}
file {
path => "C:/Program Files (x86)/dataops/webserver/Server/logs/webserver.log"
type => "webserver.log"
start_position => "beginning"
}
file {
path => "C:/Program Files (x86)/dataops/webserver/Server/logs/app.log"
type => "app"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => "previous"
charset => "ISO-8859-1"
}
start_position => "beginning"
}
}
filter {
if [type] == "webSvr" {
grok {
match => {"message" => "^%{INT:logtimestamp}%{GREEDYDATA:message}"}
overwrite => [ "message"]
}
mutate {
remove_field => [ "logtimeStamp" ]
}
}
if [type] == "webserver.log" {
grok {
match => {"message" => "\[%{HTTPDATE:logtimeStamp}\] %{IP:hostip} %{URIPROTO:method} %{URIPATH:post-data} (?:%{NOTSPACE:queryparam}|-) %{NUMBER:useragent} %{NUMBER:responsestatus} \[%{GREEDYDATA:message}\] - %{NUMBER:time-taken:int}"}
overwrite => [ "message"]
}
mutate {
remove_field => [ "logtimeStamp" ]
}
}
if [type] == "app" {
mutate {
gsub => [
"message", "\[\] ", " ",
"message", "\- ", " ",
"message", "\s+", " "
]
}
mutate {
strip => ["message"]
}
grok {
match => {"message" => ["%{TIMESTAMP_ISO8601:logtimeStamp} %{WORD:loglevel} \[%{USERNAME:httpcall}] %{USERNAME:dbName} %{USERNAME:tenant} %{INT:tenantId} %{INT:userId} %{USERNAME:session} %{GREEDYDATA:message}",
"%{TIMESTAMP_ISO8601:logtimeStamp} %{WORD:loglevel} %{GREEDYDATA:message}" ]}
overwrite => [ "message" ]
}
mutate {
remove_field => [ "logtimeStamp" ]
}
}
}
filter {
fingerprint {
method => "SHA1"
key => "103013"
}
}
output {
if [type] == "web" {
elasticsearch {
ecs_compatibility => disabled
hosts => "***************************:443"
ssl => true
index => "${NODE_ROLE}-traffic-%{+YYYY.MM.dd}"
}
}
else {
elasticsearch {
ecs_compatibility => disabled
hosts => "*****************:443"
ssl => true
index => "${NODE_ROLE}-%{+YYYY.MM.dd}"
}
}
}
please suggest.