Hi, I am trying to ship my logs from logstash to Grafana loki. I got the single line logs from logstash to Loki but i am not getting multiline logs from logstash into Loki. is there any other configuration needs to be done for the same?
This is my logstash configuration
input {
beats {
host => “localhost”
port => “5044”
type => “log”
}
}
filter{
if ([fields][log_type] == “test”) {
grok{
match => [ "message" , "%{TIMESTAMP_ISO8601:date-time}" ]
}
grok{
match => [ "message" , "%{GREEDYDATA:msg}" ]
}
grok{
match => [ "message" , "\[com\] \[%{WORD:loglevel}\]" ]
}
grok {
match => {"message" => "\[08.%{DATA:classname}\]"}
}
mutate {
add_field => {
"job" => "logstash"
}
}
}
}
output {
loki {
url => “http://localhost:3100/loki/api/v1/push”
}
stdout { codec => rubydebug{} }
}
This is my Loki configuration
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
common:
path_prefix: E:\LOKI\loki
storage:
filesystem:
chunks_directory: E:\LOKI\loki\chunks
rules_directory: E:\LOKI\loki\rules
replication_factor: 1
ring:
instance_addr: localhost
kvstore:
store: inmemory
schema_config:
configs:
- from: 2021-12-09
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h