Tanzu Hub - Example of App log forwarded from CF to Hub
search cancel

Tanzu Hub - Example of App log forwarded from CF to Hub

book

Article ID: 440422

calendar_today

Updated On:

Products

VMware Tanzu Platform - Hub

Issue/Introduction

  • This KB presents an example for users intending to direct logging based on the content of the log messages of an application in CF to Tanzu Hub.
  • Note the Techdocs location for Tanzu Hub 10.4 Monitoring and Log Forwarding for a high level overview.

Environment

Tanzu Hub 10.4

Resolution

Log messaging for Tanzu CF Apps will be presented to Tanzu Hub in the following format:

 

{
  "resourceLogs": [
    {
      "resource": {},
      "scopeLogs": [
        {
          "scope": {},
          "logRecords": [
            {
              "timeUnixNano": "1748975153771112598",
              "observedTimeUnixNano": "1748975153782471962",
              "severityNumber": 9,
              "severityText": "SEVERITY_NUMBER_INFO",
              "body": {
                "stringValue": "I, [2025-06-03T18:25:53.770818 #99]  INFO -- : Processing by HeartbeatController#server_status as HTML"
              },
              "attributes": [
                {
                  "key": "instance_id",
                  "value": {
                    "stringValue": "1"
                  }
                },
                {
                  "key": "source_id",
                  "value": {
                    "stringValue": "########-####-####-####-18753c8c1312"
                  }
                },
                {
                  "key": "job",
                  "value": {
                    "stringValue": "diego_cell"
                  }
                },
                {
                  "key": "ip",
                  "value": {
                    "stringValue": "192.168.0.10"
                  }
                },
                {
                  "key": "space_id",
                  "value": {
                    "stringValue": "########-####-####-####-1577ca776837"
                  }
                },
                {
                  "key": "app_id",
                  "value": {
                    "stringValue": "########-####-####-####-18753c8c1312"
                  }
                },
                {
                  "key": "origin",
                  "value": {
                    "stringValue": "rep"
                  }
                },
                {
                  "key": "app_name",
                  "value": {
                    "stringValue": "app-usage-server"
                  }
                },
                {
                  "key": "deployment",
                  "value": {
                    "stringValue": "cf-####################"
                  }
                },
                {
                  "key": "source_type",
                  "value": {
                    "stringValue": "APP/REV/1/PROC/WEB"
                  }
                },
                {
                  "key": "space_name",
                  "value": {
                    "stringValue": "system"
                  }
                },
                {
                  "key": "organization_id",
                  "value": {
                    "stringValue": "########-####-####-####-1ec387431cd3"
                  }
                },
                {
                  "key": "index",
                  "value": {
                    "stringValue": "########-####-####-####-7b33973420aa"
                  }
                },
                {
                  "key": "product",
                  "value": {
                    "stringValue": "Tanzu Platform for Cloud Foundry"
                  }
                },
                {
                  "key": "process_id",
                  "value": {
                    "stringValue": "########-####-####-####-18753c8c1312"
                  }
                },
                {
                  "key": "process_type",
                  "value": {
                    "stringValue": "web"
                  }
                },
                {
                  "key": "organization_name",
                  "value": {
                    "stringValue": "system"
                  }
                },
                {
                  "key": "process_instance_id",
                  "value": {
                    "stringValue": "########-####-####-####-5f72"
                  }
                },
                {
                  "key": "system_domain",
                  "value": {
                    "stringValue": "sys.test1234.cf-app.com"
                  }
                },
                {
                  "key": "APM-ID",
                  "value": {
                    "stringValue": "system-app-usage-server"
                  }
                }
              ],
              "traceId": "",
              "spanId": ""
            }
          ]
        }
      ]
    }
  ]
}