<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Data Explorer: How do I view the most recent Dimension value? in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260391#M34398</link>
    <description>&lt;P&gt;I have created a custom &lt;STRONG&gt;Log Metric&lt;/STRONG&gt; using the &lt;STRONG&gt;Occurrence of logs records&lt;/STRONG&gt; Metric measurement.&lt;/P&gt;
&lt;P&gt;It contains 2 &lt;STRONG&gt;Dimensions&lt;/STRONG&gt; that I plan to use to split and sort by.&lt;/P&gt;
&lt;P&gt;When viewing my custom Log Metric in &lt;STRONG&gt;Data Explorer&lt;/STRONG&gt;, is there a way to display only the most recent member_uuid/eventtime record?&lt;/P&gt;
&lt;P&gt;As you can see below, the same &lt;STRONG&gt;member_uuid&lt;/STRONG&gt; appears multiple times inside of the logs.&lt;/P&gt;
&lt;P&gt;But as I create the &lt;STRONG&gt;Metric Event&lt;/STRONG&gt;, all I really care about is the most recent log record entry.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ASE_1-1729716297291.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24056i1D16CE67F13DA5E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ASE_1-1729716297291.png" alt="ASE_1-1729716297291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2024 08:33:34 GMT</pubDate>
    <dc:creator>ASE</dc:creator>
    <dc:date>2024-10-24T08:33:34Z</dc:date>
    <item>
      <title>Data Explorer: How do I view the most recent Dimension value?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260391#M34398</link>
      <description>&lt;P&gt;I have created a custom &lt;STRONG&gt;Log Metric&lt;/STRONG&gt; using the &lt;STRONG&gt;Occurrence of logs records&lt;/STRONG&gt; Metric measurement.&lt;/P&gt;
&lt;P&gt;It contains 2 &lt;STRONG&gt;Dimensions&lt;/STRONG&gt; that I plan to use to split and sort by.&lt;/P&gt;
&lt;P&gt;When viewing my custom Log Metric in &lt;STRONG&gt;Data Explorer&lt;/STRONG&gt;, is there a way to display only the most recent member_uuid/eventtime record?&lt;/P&gt;
&lt;P&gt;As you can see below, the same &lt;STRONG&gt;member_uuid&lt;/STRONG&gt; appears multiple times inside of the logs.&lt;/P&gt;
&lt;P&gt;But as I create the &lt;STRONG&gt;Metric Event&lt;/STRONG&gt;, all I really care about is the most recent log record entry.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ASE_1-1729716297291.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24056i1D16CE67F13DA5E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ASE_1-1729716297291.png" alt="ASE_1-1729716297291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 08:33:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260391#M34398</guid>
      <dc:creator>ASE</dc:creator>
      <dc:date>2024-10-24T08:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer: How do I view the most recent Dimension value?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260396#M34399</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/74836"&gt;@ASE&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not too sure if there is a way to achieve this without using DQL which you wouldn't have access to if you are on Dynatrace Managed. You can use :lastreal in advanced mode but this takes the last real value of each instance of each dimension and since eventtime is a dimension it is going to evaluate it for each instance of eventtime too.&lt;/P&gt;&lt;P&gt;Also, using eventtime as a dimension could be problematic in the future if there are lots of these logs being ingested as there are limits on dimensions as mentioned in the docs &lt;A href="https://docs.dynatrace.com/docs/observe-and-explore/metrics/limits" target="_self"&gt;here&lt;/A&gt;. I'd recommend keeping track of the dimension limits using the dsfm metric&amp;nbsp;dsfm:server.metrics.custom_dimensions_usage. There are some other useful self monitoring metrics for this too.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 00:11:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260396#M34399</guid>
      <dc:creator>Fin_Ubels</dc:creator>
      <dc:date>2024-10-24T00:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer: How do I view the most recent Dimension value?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260569#M34431</link>
      <description>&lt;P&gt;Thank you for your response, &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/47376"&gt;@Fin_Ubels&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;We technically don't have to use the eventtime &lt;STRONG&gt;Dimension &lt;/STRONG&gt;in our &lt;STRONG&gt;Metric Event&lt;/STRONG&gt;, as all we really care about is the presence of the &lt;STRONG&gt;member_uuid&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I'm mainly using it to illustrate to you that the &lt;STRONG&gt;member_uuid&lt;/STRONG&gt; record shows up multiple times in the logs (and is sorted by eventime) and all we want to see is the most recent record.&lt;/P&gt;&lt;P&gt;You are correct. Using a DQL query works as expected. We can both sort and remove any duplicate member_uuids.&lt;/P&gt;&lt;P&gt;However, when we create the custom &lt;STRONG&gt;Log Metric&lt;/STRONG&gt;, we can't use the full DQL. We are limited with what we can use in the &lt;STRONG&gt;Matcher&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;We also don't want to schedule and execute a full DQL query (using a Notebook or Dashboard) to retrieve these log records, as that is what creating a custom &lt;STRONG&gt;Log Metric&lt;/STRONG&gt; is for.&lt;/P&gt;&lt;P&gt;The issue is that the log records themselves contain multiple records of the same &lt;STRONG&gt;member_uuid&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Here's a bit more context on what exactly we are trying to alert on.&lt;/P&gt;&lt;P&gt;We are planing to alert when the DQL query below returns any records. Value &amp;gt; 0.&lt;/P&gt;&lt;P&gt;I decided to create 2 separate Log Metrics, as these are technically 2 separate DQL queries that are joined. Each query is for a different entity's logs.&lt;/P&gt;&lt;P&gt;My thought is to use a Metric Expression in our &lt;STRONG&gt;Metric Event&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;When Log Metric 1 + Log Metric 2 = 2, send us an alert.&lt;/P&gt;&lt;P&gt;We only care about a &lt;STRONG&gt;member_uuid&lt;/STRONG&gt; that appears in BOTH Log Metrics at the same time.&lt;/P&gt;&lt;P&gt;1 + 1 = 2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| filter dt.system.bucket == "bucket_name_1"
| filter dt.host_group.id == "host_group_id_name"
| parse content, "JSON:event"
| filter event[message] == "message_name"
| filter event[product_type] == "product_type_name"
| fieldsAdd member_uuid = event[member_uuid]
| join [	
fetch logs
| filter dt.system.bucket == "bucket_name_2"
| filter ecs_cluster == "ecs_cluster_name"
| filter matchesValue(requirement, "requirement_name")
| dedup member_uuid, sort: { timestamp desc }
], on: { member_uuid }
| filter right.requirement_status == "requirement_status_name"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 16:51:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Data-Explorer-How-do-I-view-the-most-recent-Dimension-value/m-p/260569#M34431</guid>
      <dc:creator>ASE</dc:creator>
      <dc:date>2024-10-24T16:51:19Z</dc:date>
    </item>
  </channel>
</rss>

