Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-17306

Filter out MOTD logging from 'llapstatus' command in order to get the output which is JSON parsable.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • ambari-server
    • None

    Description

      Example of expected response which can be JSON parsed:

      CASE A:

      {
        "amInfo" : {
          "appName" : "llap0",
          "appType" : "org-apache-slider",
          "appId" : "application_1466036628595_0010",
          "containerId" : "container_1466036628595_0010_01_000001",
          "hostname" : "hostname",
          "amWebUrl" : "http://hostname:60865/"
        },
        "state" : "LAUNCHING",
        "originalConfigurationPath" : "hdfs://hostname:8020/user/hive/.slider/cluster/llap0/snapshot",
        "generatedConfigurationPath" : "hdfs://hostname:8020/user/hive/.slider/cluster/llap0/generated",
        "desiredInstances" : 1,
        "liveInstances" : 0,
        "appStartTime" : 1466123287309
      }
      

      The same output with MOTD message:

      This is MOTD message
      This is MOTD message1
      {
        "amInfo" : {
          "appName" : "llap0",
          "appType" : "org-apache-slider",
          "appId" : "application_1466036628595_0010",
          "containerId" : "container_1466036628595_0010_01_000001",
          "hostname" : "hostname",
          "amWebUrl" : "http://hostname:60865/"
        },
        "state" : "LAUNCHING",
        "originalConfigurationPath" : "hdfs://hostname:8020/user/hive/.slider/cluster/llap0/snapshot",
        "generatedConfigurationPath" : "hdfs://hostname:8020/user/hive/.slider/cluster/llap0/generated",
        "desiredInstances" : 1,
        "liveInstances" : 0,
        "appStartTime" : 1466123287309
      }
      

      Other scenario can be (eg: APP_NOTFOUND):

      CASE B:

      This is MOTD message
      This is MOTD message1
      {
        "state" : "APP_NOT_FOUND"
      }
      
      • We need to filter out extra lines initially added on top of JSON parseable string.

      Attachments

        1. AMBARI-17306.patch
          29 kB
          Swapan Shridhar

        Issue Links

          Activity

            People

              swapanshridhar Swapan Shridhar
              swapanshridhar Swapan Shridhar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: