# Converting splunk query to DQL timeseries

**URL:** <https://community.dynatrace.com/t/converting-splunk-query-to-dql-timeseries/47549>\
**Category:** DQL\
**Tags:** dashboards\
**Created:** [September 9, 2024, 2:34pm UTC](https://community.dynatrace.com/t/converting-splunk-query-to-dql-timeseries/47549 "2024-09-09T14:34:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![esm9374\_hca](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@esm9374\_hca](https://community.dynatrace.com/u/esm9374_hca)\
**Post date:** [September 9, 2024, 2:34pm UTC](https://community.dynatrace.com/t/converting-splunk-query-to-dql-timeseries/47549/1 "2024-09-09T14:34:42Z")

</div>

I am in process of rebuilding all of our Splunk Dashboards over to Dynatrace Dashboards. A lot of our Dashboards are asking us for the latest value. Below is the splunk query.

| mstats latest(vault.token.count.by\_auth.value) as count where `vault_telemetry` AND cluster=\* AND namespace IN (“\*”) by cluster,namespace,auth\_method span=10m  
| stats sum(count) as count by \_time,auth\_method  
| eventstats latest(\_time) as latesttime  
| where \_time == latesttime  
| stats max(count) as count by auth\_method

Maybe I am approaching this issue wrong but I would think you would need to do a time series for and some how pull the latest value in like an array and then do something with it to make this happen. Any advice would greatly be apperciated.

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [September 9, 2024, 11:11pm UTC](https://community.dynatrace.com/t/converting-splunk-query-to-dql-timeseries/47549/2 "2024-09-09T23:11:56Z")

</div>

Hey esm, if you want to pull the latest value from a timeseries you could do something like:

```markup
timeseries count = count(dt.host.availability)
| fields count = arrayLast(count)

```

This would return 1 field called count containing the latest value. For more information regarding available array functions including examples you can find them here:&nbsp;[Array functions — Dynatrace Docs](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/array-functions)
