<?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 Lookup value from entity with the parsed value from logs in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Lookup-value-from-entity-with-the-parsed-value-from-logs/m-p/253097#M1119</link>
    <description>&lt;P&gt;I have the content with json in logs which has a key &lt;FONT face="andale mono,times"&gt;client_ip&lt;/FONT&gt; and trying to get the pod name which has &lt;FONT face="andale mono,times"&gt;internalIpAddresses&lt;/FONT&gt; from &lt;FONT face="andale mono,times"&gt;dt.entity.cloud_application_instance&lt;/FONT&gt;. So trying to lookup the IP I got from the logs &lt;FONT face="andale mono,times"&gt;client_ip&lt;/FONT&gt; with &lt;FONT face="andale mono,times"&gt;internalIpAddresses&lt;/FONT&gt; and get the pod name (&lt;FONT face="andale mono,times"&gt;entity.name&lt;/FONT&gt;). But &lt;FONT face="andale mono,times"&gt;lookup&lt;/FONT&gt; always returns &lt;FONT face="andale mono,times"&gt;null&lt;/FONT&gt; values. Please help advise. TIA.&lt;/P&gt;&lt;PRE&gt;fetch logs&lt;BR /&gt;| filter matchesValue(aws.log_group, "/aws/logs/alb")&lt;BR /&gt;| parse content , "JSON:record"&lt;BR /&gt;| fieldsAdd record[client_ip], alias:client_ip&lt;BR /&gt;| fieldsAdd record[domain_name], alias:domain_name&lt;BR /&gt;| fieldsAdd record[elb_status_code], alias:elb_status_code&lt;BR /&gt;| filter client_ip != ""&lt;BR /&gt;| fields timestamp, client_ip, domain_name, elb_status_code&lt;BR /&gt;| lookup sourceField:client_ip, lookupField:internalIpAddresses, [fetch dt.entity.cloud_application_instance], fields:{entity.name}&lt;/PRE&gt;&lt;P&gt;Sample log content.&lt;/P&gt;&lt;PRE&gt;{ "client_ip": "192.168.2.3", "target_port": 443, "elb_status_code": "200", "target_status_code": "200", "request_verb": "POST", "domain_name": "example.com" }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2024 22:57:43 GMT</pubDate>
    <dc:creator>zip-chanko</dc:creator>
    <dc:date>2024-08-09T22:57:43Z</dc:date>
    <item>
      <title>Lookup value from entity with the parsed value from logs</title>
      <link>https://community.dynatrace.com/t5/DQL/Lookup-value-from-entity-with-the-parsed-value-from-logs/m-p/253097#M1119</link>
      <description>&lt;P&gt;I have the content with json in logs which has a key &lt;FONT face="andale mono,times"&gt;client_ip&lt;/FONT&gt; and trying to get the pod name which has &lt;FONT face="andale mono,times"&gt;internalIpAddresses&lt;/FONT&gt; from &lt;FONT face="andale mono,times"&gt;dt.entity.cloud_application_instance&lt;/FONT&gt;. So trying to lookup the IP I got from the logs &lt;FONT face="andale mono,times"&gt;client_ip&lt;/FONT&gt; with &lt;FONT face="andale mono,times"&gt;internalIpAddresses&lt;/FONT&gt; and get the pod name (&lt;FONT face="andale mono,times"&gt;entity.name&lt;/FONT&gt;). But &lt;FONT face="andale mono,times"&gt;lookup&lt;/FONT&gt; always returns &lt;FONT face="andale mono,times"&gt;null&lt;/FONT&gt; values. Please help advise. TIA.&lt;/P&gt;&lt;PRE&gt;fetch logs&lt;BR /&gt;| filter matchesValue(aws.log_group, "/aws/logs/alb")&lt;BR /&gt;| parse content , "JSON:record"&lt;BR /&gt;| fieldsAdd record[client_ip], alias:client_ip&lt;BR /&gt;| fieldsAdd record[domain_name], alias:domain_name&lt;BR /&gt;| fieldsAdd record[elb_status_code], alias:elb_status_code&lt;BR /&gt;| filter client_ip != ""&lt;BR /&gt;| fields timestamp, client_ip, domain_name, elb_status_code&lt;BR /&gt;| lookup sourceField:client_ip, lookupField:internalIpAddresses, [fetch dt.entity.cloud_application_instance], fields:{entity.name}&lt;/PRE&gt;&lt;P&gt;Sample log content.&lt;/P&gt;&lt;PRE&gt;{ "client_ip": "192.168.2.3", "target_port": 443, "elb_status_code": "200", "target_status_code": "200", "request_verb": "POST", "domain_name": "example.com" }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 22:57:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Lookup-value-from-entity-with-the-parsed-value-from-logs/m-p/253097#M1119</guid>
      <dc:creator>zip-chanko</dc:creator>
      <dc:date>2024-08-09T22:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value from entity with the parsed value from logs</title>
      <link>https://community.dynatrace.com/t5/DQL/Lookup-value-from-entity-with-the-parsed-value-from-logs/m-p/253100#M1120</link>
      <description>&lt;P&gt;This is resolved after I changed the lookup query where the &lt;FONT face="andale mono,times"&gt;internalIpAddresses&lt;/FONT&gt; is array and need to convert into string something like &lt;FONT face="andale mono,times"&gt;internalIpAddresses[0]&lt;/FONT&gt;. Thanks&amp;nbsp;&lt;SPAN&gt;Angel Mariya Paul from support team.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2024 09:36:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Lookup-value-from-entity-with-the-parsed-value-from-logs/m-p/253100#M1120</guid>
      <dc:creator>zip-chanko</dc:creator>
      <dc:date>2024-08-10T09:36:16Z</dc:date>
    </item>
  </channel>
</rss>

