Still same, sharing all log information for your analysis,
Logstash output:
"message" => "\nThread 1 advanced to log sequence 104 (LGWR switch)\n Current log# 2 seq# 104 mem# 0: /u01/app/oracle/oradata/ORCLDR/redo02.log\n2024-01-23T23:48:50.720887+05:30\nARC3 (PID:3228): Archived Log entry 88 added for T-1.S-103 ID 0x6484cf48 LAD:1",
"@version" => "1",
"@timestamp" => "2024-01-23T18:18:50.645Z",
"path" => "/u01/app/oracle/diag/rdbms/orcldr/orcldr/trace/alert_orcldr.log",
"host" => "srvdb03.localdomain",
"tags" => [
[0] "multiline"
],
"oradb_status" => "running",
"timezone" => "+05:30"
}
Sample Full log:
2024-01-23T22:51:58.460534+05:30
Thread 1 advanced to log sequence 100 (LGWR switch)
Current log# 1 seq# 100 mem# 0: /u01/app/oracle/oradata/ORCLDR/redo01.log
2024-01-23T22:51:58.773065+05:30
ARC3 (PID:3228): Archived Log entry 84 added for T-1.S-99 ID 0x6484cf48 LAD:1
2024-01-23T23:03:23.492049+05:30
Warning: VKTM detected a forward time drift.
Time drifts can result in unexpected behavior such as time-outs.
Please see the VKTM trace file for more details:
/u01/app/oracle/diag/rdbms/orcldr/orcldr/trace/orcldr_vktm_3146.trc
2024-01-23T23:09:57.352911+05:30
Thread 1 advanced to log sequence 101 (LGWR switch)
Current log# 2 seq# 101 mem# 0: /u01/app/oracle/oradata/ORCLDR/redo02.log
2024-01-23T23:09:57.855023+05:30
ARC0 (PID:3218): Archived Log entry 85 added for T-1.S-100 ID 0x6484cf48 LAD:1
2024-01-23T23:14:13.797045+05:30
Thread 1 advanced to log sequence 102 (LGWR switch)
Current log# 3 seq# 102 mem# 0: /u01/app/oracle/oradata/ORCLDR/redo03.log
2024-01-23T23:14:14.004318+05:30
ARC1 (PID:3224): Archived Log entry 86 added for T-1.S-101 ID 0x6484cf48 LAD:1
2024-01-23T23:27:11.624120+05:30
Thread 1 advanced to log sequence 103 (LGWR switch)
Current log# 1 seq# 103 mem# 0: /u01/app/oracle/oradata/ORCLDR/redo01.log
2024-01-23T23:27:11.690924+05:30
ARC2 (PID:3226): Archived Log entry 87 added for T-1.S-102 ID 0x6484cf48 LAD:1
2024-01-23T23:48:50.645593+05:30
Thread 1 advanced to log sequence 104 (LGWR switch)
Current log# 2 seq# 104 mem# 0: /u01/app/oracle/oradata/ORCLDR/redo02.log
2024-01-23T23:48:50.720887+05:30
ARC3 (PID:3228): Archived Log entry 88 added for T-1.S-103 ID 0x6484cf48 LAD:1
Logstash configuration:
input {
file {
path => "/u01/app/oracle/diag/rdbms/orcldr/orcldr/trace/alert_orcldr.log"
}
}
filter {
multiline {
pattern => "%{TIMESTAMP_ISO8601}"
negate => true
what => "previous"
}
if [message] =~ /Starting ORACLE instance/ {
mutate {
add_field => [ "oradb_status", "starting" ]
}
} else if [message] =~ /Instance shutdown complete/ {
mutate {
add_field => [ "oradb_status", "shutdown" ]
}
} else {
mutate {
add_field => [ "oradb_status", "running" ]
}
}
if [message] =~ /ORA-/ {
grok {
match => [ "message","(?ORA-[0-9]*)" ]
}
}
grok {
match => [ "message","%{TIMESTAMP_ISO8601:timestamp}(?<log_message>.*$)" ]
}
date {
locale => "en"
match => [ "timestamp","ISO8601"]
target => "@timestamp"
}
mutate { replace => [ "message", "%{log_message}" ] }
}
output {
stdout {codec => rubydebug}
elasticsearch {
hosts => ["localhost:9200"]
index => "oracle-%{+YYYY.MM.dd}"
}
}