Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-4792

Logging must-gather producing clusterlogging and clusterlogforwarder files content in a single line

XMLWordPrintable

    • False
    • None
    • False
    • NEW
    • NEW
    • Before this fix, the yaml content from the logging must-gather was exported in a single line making it not readable. This update preserves the yaml white spaces so that the file has proper formatting.
    • Bug Fix
    • Log Collection - Sprint 245, Log Collection - Sprint 246, Log Collection - Sprint 247, Log Collection - Sprint 248, Log Collection - Sprint 249
    • Important

      Description of problem:

      When collecting logging data for Red Hat Support as indicated in the documentation [1] the yaml content of the files in the logging must-gather is a single line making it not readable:

        - `/<path to logging must-gather>/clusterlogging/clo/openshift-logging/clusterlogforwarder_instance.yaml`
        -  `/<path to logging must-gather>/clusterlogging/clo/openshift-logging/clusterlogging_instance.yaml`

      $ wc -l clusterlogging_instance.yaml 
      1 clusterlogging_instance.yaml
      
      $ wc -l clusterlogforwarder_instance.yaml
      1 clusterlogforwarder_instance.yaml 
      

      Example of the `clusterlogging_instance.yaml` output:

      $ cat clusterlogging_instance.yaml 
      apiVersion: logging.openshift.io/v1 kind: ClusterLogging metadata: creationTimestamp: "2023-11-08T09:33:02Z" generation: 2 name: instance namespace: openshift-logging resourceVersion: "2578359" uid: 1bec7110-06d4-4914-93dc-eea7ed2135dd spec: collection: type: fluentd logStore: elasticsearch: nodeCount: 1 redundancyPolicy: ZeroRedundancy resources: requests: memory: 2Gi retentionPolicy: audit: maxAge: 7d type: elasticsearch managementState: Managed visualization: kibana: replicas: 1 type: kibana status: conditions: - lastTransitionTime: "2023-11-08T09:33:02Z" status: "True" type: Ready logStore: elasticsearchStatus: - cluster: activePrimaryShards: 6 activeShards: 6 initializingShards: 0 numDataNodes: 1 numNodes: 1 pendingTasks: 0 relocatingShards: 0 status: green unassignedShards: 0 clusterName: elasticsearch nodeConditions: elasticsearch-cdm-40yljwnj-1: [] nodeCount: 1 pods: client: failed: [] notReady: [] ready: - elasticsearch-cdm-40yljwnj-1-6c7f64f4cb-jwrnp data: failed: [] notReady: [] ready: - elasticsearch-cdm-40yljwnj-1-6c7f64f4cb-jwrnp master: failed: [] notReady: [] ready: - elasticsearch-cdm-40yljwnj-1-6c7f64f4cb-jwrnp shardAllocationEnabled: all visualization: kibanaStatus: - deployment: kibana pods: failed: [] notReady: [] ready: - kibana-5b9968856d-kv5w6 replicaSets: - kibana-5b9968856d replicas: 1
      

      Version-Release number of selected component (if applicable):

      Logging 5.8

      How reproducible:

      Always

      Steps to Reproduce:

      1.  Run logging must-gather as indicated in the Logging documentation [1]
      2.  Review the content of the files
          - `/<path to logging must-gather>/clusterlogging/clo/openshift-logging/clusterlogforwarder_instance.yaml`
          -  `/<path to logging must-gather>/clusterlogging/clo/openshift-logging/clusterlogging_instance.yaml`

      Actual results:

      Files below are containing the yaml definitions and status in a single line:
        - `/<path to logging must-gather>/clusterlogging/clo/openshift-logging/clusterlogforwarder_instance.yaml`
        -  `/<path to logging must-gather>/clusterlogging/clo/openshift-logging/clusterlogging_instance.yaml`

      Expected results:

      The yaml contained in the files indicated is in multiple lines similar to below for making it more readable:

      $ oc get clusterlogging instance -o yaml  -n openshift-logging
      apiVersion: logging.openshift.io/v1
      kind: ClusterLogging
      metadata:
        creationTimestamp: "2023-11-08T09:33:02Z"
        generation: 2
        name: instance
        namespace: openshift-logging
        resourceVersion: "2578359"
        uid: 1bec7110-06d4-4914-93dc-eea7ed2135dd
      spec:
        collection:
          type: fluentd
        logStore:
          elasticsearch:
            nodeCount: 1
            redundancyPolicy: ZeroRedundancy
            resources:
              requests:
                memory: 2Gi
          retentionPolicy:
            audit:
              maxAge: 7d
          type: elasticsearch
      ...
      

       

       [1] https://docs.openshift.com/container-platform/4.13/logging/cluster-logging-support.html#cluster-logging-support-must-gather

            oarribas@redhat.com Oscar Arribas Arribas
            rhn-support-ocasalsa Oscar Casal Sanchez
            Anping Li Anping Li
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: