You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Swapan Shridhar (JIRA)" <ji...@apache.org> on 2016/06/18 01:14:05 UTC

[jira] [Updated] (AMBARI-17306) Filter out MOTD logging from 'llapstatus' command in order to get the output which is JSON parsable.

     [ https://issues.apache.org/jira/browse/AMBARI-17306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapan Shridhar updated AMBARI-17306:
-------------------------------------
    Description: 
Example of expected response which can be JSON parsed:

*CASE A:*

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

The same output with MOTD message:

{code}
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" : "ts-hs2ia-0615-r-2.openstacklocal",
    "amWebUrl" : "http://ts-hs2ia-0615-r-2.openstacklocal:60865/"
  },
  "state" : "LAUNCHING",
  "originalConfigurationPath" : "hdfs://ts-hs2ia-0615-r-5.openstacklocal:8020/user/hive/.slider/cluster/llap0/snapshot",
  "generatedConfigurationPath" : "hdfs://ts-hs2ia-0615-r-5.openstacklocal:8020/user/hive/.slider/cluster/llap0/generated",
  "desiredInstances" : 1,
  "liveInstances" : 0,
  "appStartTime" : 1466123287309
}
{code}

Other scenario can be (eg: APP_NOTFOUND):

*CASE B:*

{code}
This is MOTD message
This is MOTD message1
{
  "state" : "APP_NOT_FOUND"
}
{code}


- We need to filter out extra lines initially added on top of JSON parseable string.

> Filter out MOTD logging from 'llapstatus' command in order to get the output which is JSON parsable.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: AMBARI-17306
>                 URL: https://issues.apache.org/jira/browse/AMBARI-17306
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.4.0
>            Reporter: Swapan Shridhar
>            Assignee: Swapan Shridhar
>             Fix For: 2.4.0
>
>
> Example of expected response which can be JSON parsed:
> *CASE A:*
> {code}
> {
>   "amInfo" : {
>     "appName" : "llap0",
>     "appType" : "org-apache-slider",
>     "appId" : "application_1466036628595_0010",
>     "containerId" : "container_1466036628595_0010_01_000001",
>     "hostname" : "ts-hs2ia-0615-r-2.openstacklocal",
>     "amWebUrl" : "http://ts-hs2ia-0615-r-2.openstacklocal:60865/"
>   },
>   "state" : "LAUNCHING",
>   "originalConfigurationPath" : "hdfs://ts-hs2ia-0615-r-5.openstacklocal:8020/user/hive/.slider/cluster/llap0/snapshot",
>   "generatedConfigurationPath" : "hdfs://ts-hs2ia-0615-r-5.openstacklocal:8020/user/hive/.slider/cluster/llap0/generated",
>   "desiredInstances" : 1,
>   "liveInstances" : 0,
>   "appStartTime" : 1466123287309
> }
> {code}
> The same output with MOTD message:
> {code}
> 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" : "ts-hs2ia-0615-r-2.openstacklocal",
>     "amWebUrl" : "http://ts-hs2ia-0615-r-2.openstacklocal:60865/"
>   },
>   "state" : "LAUNCHING",
>   "originalConfigurationPath" : "hdfs://ts-hs2ia-0615-r-5.openstacklocal:8020/user/hive/.slider/cluster/llap0/snapshot",
>   "generatedConfigurationPath" : "hdfs://ts-hs2ia-0615-r-5.openstacklocal:8020/user/hive/.slider/cluster/llap0/generated",
>   "desiredInstances" : 1,
>   "liveInstances" : 0,
>   "appStartTime" : 1466123287309
> }
> {code}
> Other scenario can be (eg: APP_NOTFOUND):
> *CASE B:*
> {code}
> This is MOTD message
> This is MOTD message1
> {
>   "state" : "APP_NOT_FOUND"
> }
> {code}
> - We need to filter out extra lines initially added on top of JSON parseable string.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)