# Fetch logs from timestamp with filters

**URL:** <https://community.dynatrace.com/t/fetch-logs-from-timestamp-with-filters/44526>\
**Category:** DQL\
**Tags:** dql, dashboards, logs\
**Created:** [March 8, 2024, 11:04am UTC](https://community.dynatrace.com/t/fetch-logs-from-timestamp-with-filters/44526 "2024-03-08T11:04:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexisGND](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@AlexisGND](https://community.dynatrace.com/u/AlexisGND)\
**Post date:** [March 8, 2024, 11:04am UTC](https://community.dynatrace.com/t/fetch-logs-from-timestamp-with-filters/44526/1 "2024-03-08T11:04:30Z")

</div>

Hi,

I created a dashboard with is counting the number of raw per hours with personnalized ingested data.

![AlexisGND_3-1709895550612.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/1/b1b1acab10a8662ed7567c3ec75cf5d2dc6c5d63.png)

I have a filter that contains numbers representing the day :

 ![AlexisGND_2-1709895412595.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/8/7802f4b95c03b0c013ac44127a6efebf571ce8c7.png)

And my wish is to set the timestamp day filtering of these counting&nbsp;tiles, with the one selected in the filter, but there is a problem :

 ![AlexisGND_1-1709895371532.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8c00da05a0989d1bcc4a05046778d0f16b530244.png)

The idea is not to set the global timeframe of the dashboard to the beginning of the year (takes too long), that’s why i want every tiles to get the day of the filter in case i want to switch between yesterday and other previous days.

Is this even possible ? or is there another way to do it ?

Thanks in advance for your response 🙂

---

<div class="post-metadata">

**Author:** ![wouterdt](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wouterdt/32/25147_2.png) [@wouterdt](https://community.dynatrace.com/u/wouterdt)\
**Post date:** [March 8, 2024, 11:36am UTC](https://community.dynatrace.com/t/fetch-logs-from-timestamp-with-filters/44526/2 "2024-03-08T11:36:04Z")

</div>

should you not use a [casting function](https://docs.dynatrace.com/docs/shortlink/conversion-and-casting-functions#toTimeframe) instead of concat?

---

<div class="post-metadata">

**Author:** ![AlexisGND](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@AlexisGND](https://community.dynatrace.com/u/AlexisGND)\
**Post date:** [March 11, 2024, 10:31am UTC](https://community.dynatrace.com/t/fetch-logs-from-timestamp-with-filters/44526/3 "2024-03-11T10:31:12Z")

</div>

**At the end, it worked with the concat :**

fetch logs, from: toTimestamp(concat($Year, “-”, $Month, “-”, $Day, “T00:00:00.000Z”)), to: toTimestamp(concat($Year, “-”, $Month, “-”, $Day, “T23:59:59.000Z”))

I don’t possess enough technical knowledge of dql for using casting function and I think it’s not adapted with my situation, maybe I am wrong.

But the end result is what I wanted.  
Thanks for your idea, I will work on the casting function, see if it’s more optimized or not.
