When downloading logs of a certain pod, the newest logs are on the top which is confusing for any user, is there any way to download in the normal order (Ascendant order)?
Yes there is.
If youâre using Grafana:
Note the âdirectionâ setting at the bottom of the screenshot, and the query API are also takes a direction
parameters.
Which version of grafana is this because mine only shows a âFlip results orderâ button and when i click it i get the same results:
Yeah thatâs the same feature, just renamed I believe.
It shouldnât be returning the same results, though.
Please select
and then in the Query tab
execute the query and send me the request
URL.
I clicked on Flip results order and then run the query, here is the request url in the inspector the direction is always BACKWORD
api/datasources/proxy/2/loki/api/v1/query_range?direction=BACKWARD&limit=1000&query=%7Bname%3D%123%22%7D&start=1646840780521000000&end=1646844380521000000&step=2
Unfortunately I think Grafana only reverses the order of the logs returned and doesnât issue a âforwardâ query.
You can use logcli to issue a --forward query.
I think it would be nice if the button in Grafana did this rather than just reversing the results
Would you consider opening an issue in the Grafana repo?
Ok, but is there any workaround other than using LogCli to make logs direction always forward?
@dannykopping in which grafana and loki version I can find that âDisplay resultsâ option?
Iâm running v8.5.0, which version are you on?
I run v8.4.3, which is the latest release
Ah, I appear to be running the pre-release version.
If the UI is not changing the direction
parameter, that is a bug and should be reported at GitHub - grafana/grafana: The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more. please.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.