-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement use_incoming_timestamp #2780
Comments
same issue existed in promtail?
|
Any example log I can test with? I don't think I've had issue extracting timestamp from logs, JSON or otherwise. |
I commented with an example on #2393 that I haven’t been able to get working. |
|
More examples, to show that it's not an issue with parsing the timestamp. (If you turn on debug output you can see the failures noted.) All of the log lines where the timestamps DO parse should have the timestamp of Configloki.source.file "test" {
forward_to = [loki.process.process_logs.receiver]
targets = [{"__path__" = "/test.log"}]
}
loki.process "process_logs" {
forward_to = [loki.echo.debug.receiver, loki.write.default.receiver]
stage.json {
expressions = {
extracted_ts = "timestamp",
}
}
stage.timestamp {
action_on_failure = "fudge"
fallback_formats = [
"2006-01-02 15:04:05.000000-0700",
"RFC3339Nano",
]
format = "2006-01-02 15:04:05.999999-0700"
source = "extracted_ts"
}
}
loki.echo "debug" { }
loki.write "default" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
} Log
loki.echo Output
loki.write Output (via Grafana)
|
I tested both the configurations in #2780 (comment) and in the original post, and in both cases I saw proper timestamp parsing. The Can you help me understand what causes you to say that the field is not being parsed/used? |
@dehaansa if you look at the example closely, the timestamp of the four log lines are not in order, and I suspect that might've been the issue. |
I updated my example to have the timestamps be one second apart, in order, and within a minute of the scrape. Still getting the same results in Grafana. Going to try building #2798 to see if I can test with |
Request
greetings
would really be nice if
use_incoming_timestamp
could be implemented withstage.*
Currently, there seems to either be a bug or something else where in you cannot use timestamp coming from json logs.
Thanks!
Use case
because I am not able to capture timestamp from log itself. Gracias
The text was updated successfully, but these errors were encountered: