Open sbvitok opened 3 years ago
Redash uses MomentJS for date handling. Clickhouse is returning dates in this format 2021-01-27T00:00:01.733983944+03:00
which is not recognized by Moment.
Redash uses MomentJS for date handling. Clickhouse is returning dates in this format
2021-01-27T00:00:01.733983944+03:00
which is not recognized by Moment.
"message" column is sting.
CREATE TABLE logs.raw (`stream` String, `message` String, `namespace` String, `deploy_name` String, `node_name` String, `pod_name` String, `container_name` String, `app_name` String, `date
time` DateTime, `timestamp` Float64, `offset` Int64)
and it's 2021-01-27T00:00:01.733983944+03:00
just time format from app logs, which is in the log itself
@sbvitok If you want to show that value as is, edit this table ("Edit Visualization" button) and change "Display as" for that column
@sbvitok If you want to show that value as is, edit this table ("Edit Visualization" button) and change "Display as" for that column
Don't work. I try execute query again , after set "Display as", but no changes.
Column datetime
is still displayed as Date/Time
- so I see no changes. Also, do you see any error messages in browser console?
Column
datetime
is still displayed asDate/Time
- so I see no changes. Also, do you see any error messages in browser console?
with datetime
column no problem. why need to change its data type?
problem in message
column after set "Display as" to Text
instead of log body I have NaN
without any error in concole
Oh, right, I misunderstood the issue 🤦 I'll try to reproduce this issue and then will get back to you
Okay. So, I managed to reproduce it, and yeah, that's a bug - regular expressions we use to detect date/time string have anchor on beginning, but allow any garbage at the and, but Moment fails to parse such strings.
Related to: getredash/redash#3553
As a temporary solution you can try to prepend any character to the beginning of your log strings (e.g. whitespace) - if will prevent this code from messing up the data.
As a temporary solution you can try to prepend any character to the beginning of your log strings (e.g. whitespace) - if will prevent this code from messing up the data.
Yes, that's how I solved the problem.
you cat just concat space to message :)
select concat(' ', message) from ...
Is this resolved in the frontend? I am still seeing a invalid date when do I snowflake select query through redash. With concat I am getting the proper string value(eg: 2021-05-18T15:49:16.54Z#1aaf1b6d-b7f0-11eb-b4e2-da0a7baaae) My redash browser Version: 8.0.0+b32245
Issue Summary
I read logs from ClickHouse via Redash and have a problem with invalid date message in text column.
SQL
select datetime, pod_name, message from logs.raw where datetime >= '{{ Date.start }}' and datetime <= '{{ Date.end }}' and app_name = '{{app_name}}' and (message {{message}}) order by datetime,timestamp desc limit 5000
output form postgres
output debug console from firefox:
Technical details: