Kibana 将时间戳转换为本地时区
Kibana converting timestamp to local timezone
我已经使用 FileBeat 设置了 ELK,并且我将日志转发到弹性搜索,覆盖 @timestamp 字段到我的日志文件中的时间。下面是那个
的 logstash.conf 文件
input {
beats {
port => 5044
codec => multiline {
# Grok pattern names are valid! :)
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
}
filter {
mutate {
gsub => ["message", "\n", " "]
}
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} \[%{NOTSPACE:uid}\] \[%{NOTSPACE:thread}\] %{LOGLEVEL:loglevel} %{DATA:class}\-%{GREEDYDATA:message}" ]
overwrite => [ "message" ]
}
date {
match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss" ]
target => "@timestamp"
timezone => "UTC+0530"
}
if "_grokparsefailure" in [tags] {
drop { }
}
}
output {
elasticsearch { hosts => localhost }
stdout { codec => rubydebug }
}
在上面,我尝试使用
将时间戳的时区设置为 IST
timezone => "UTC+0530"
但我收到错误
Cannot load an invalid configuration {:reason=>"The datetime zone id 'UTC+0530' is not recognised"}
为了避免 kibana 将时间戳转换为我的本地时区,这是必需的,因为时间戳已经在本地时区 IST 中。
谁能告诉我如何为时间戳设置 IST 时区或设置 kibana 不将时间戳转换为本地时区?
看到讨论并找到了答案。 kibana 高级设置中有一个选项可以将时间戳时区从默认 'Browser' 更改为您的本地时区。 https://discuss.elastic.co/t/timezone-utc-00-00-getting-converted-on-kibana-display-to-05-30/38727/2
根据手册,时区的值应该是 Joda-Time 的 "Canonical ID":没有这样的 UTC+0530
时区。
我已经使用 FileBeat 设置了 ELK,并且我将日志转发到弹性搜索,覆盖 @timestamp 字段到我的日志文件中的时间。下面是那个
的 logstash.conf 文件input {
beats {
port => 5044
codec => multiline {
# Grok pattern names are valid! :)
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
}
filter {
mutate {
gsub => ["message", "\n", " "]
}
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} \[%{NOTSPACE:uid}\] \[%{NOTSPACE:thread}\] %{LOGLEVEL:loglevel} %{DATA:class}\-%{GREEDYDATA:message}" ]
overwrite => [ "message" ]
}
date {
match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss" ]
target => "@timestamp"
timezone => "UTC+0530"
}
if "_grokparsefailure" in [tags] {
drop { }
}
}
output {
elasticsearch { hosts => localhost }
stdout { codec => rubydebug }
}
在上面,我尝试使用
将时间戳的时区设置为 ISTtimezone => "UTC+0530"
但我收到错误
Cannot load an invalid configuration {:reason=>"The datetime zone id 'UTC+0530' is not recognised"}
为了避免 kibana 将时间戳转换为我的本地时区,这是必需的,因为时间戳已经在本地时区 IST 中。
谁能告诉我如何为时间戳设置 IST 时区或设置 kibana 不将时间戳转换为本地时区?
看到讨论并找到了答案。 kibana 高级设置中有一个选项可以将时间戳时区从默认 'Browser' 更改为您的本地时区。 https://discuss.elastic.co/t/timezone-utc-00-00-getting-converted-on-kibana-display-to-05-30/38727/2
根据手册,时区的值应该是 Joda-Time 的 "Canonical ID":没有这样的 UTC+0530
时区。