Wednesday, 12 April 2017

Generating extra/unwanted Question mark in Json file

I was trying to copy content from my repo to create a json file in servers using AWS Beanstalk problem is it is generating a question mark at end as

input (my repo)

# This will automatically install the Sumo Logic collector on AWS EB
packages:
  rpm:
    SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64

files:
  "/etc/sumo_sources.json":
    mode: "000755"
    owner: root
    group: root
    content: |
      {
        "api.version": "v1",
        "sources": [
          {
            "sourceType": "LocalFile",
            "name": "docker",
            "pathExpression": "/var/log/eb-docker/containers/eb-current-app/*-stdouterr.log",
            "category": "365_aws_ec2"
          },
          {
            "sourceType": "LocalFile",
            "name": "eb activity",
            "pathExpression": "/var/log/eb-activity.log",
            "category": "365_aws_ec2"
          },
          {
            "sourceType": "LocalFile",
            "name": "nginx access",
            "pathExpression": "/var/log/nginx/access.log",
            "category": "365_aws_ec2"
          },
          {
            "sourceType": "LocalFile",
            "name": "nginx error",
            "pathExpression": "/var/log/nginx/error.log",
            "category": "365_aws_ec2"
          } 
        ]
      }

container_commands:
  00-setup-nginx-conf:
    command: "cp .ebextensions/write_nginx_conf.sh /opt/elasticbeanstalk/hooks/appdeploy/enact/02_write_nginx_conf.sh && chmod +x /opt/elasticbeanstalk/hooks/appdeploy/enact/02_write_nginx_conf.sh"
  01-setup-sumo-conf:
    command: /bin/bash .ebextensions/write_sumo_conf.sh
  02-start-sumo-collector:
    command: sudo service collector start || true

the output of the file is generating this way with questionmark at end

{
  "api.version": "v1",
  "sources": [
    {
      "sourceType": "LocalFile",
      "name": "docker",
      "pathExpression": "/var/log/eb-docker/containers/eb-current-app/*-stdouterr.log",
      "category": "365_aws_ec2"
    },
    {
      "sourceType": "LocalFile",
      "name": "eb activity",
      "pathExpression": "/var/log/eb-activity.log",
      "category": "365_aws_ec2"
    },
    {
      "sourceType": "LocalFile",
      "name": "nginx access",
      "pathExpression": "/var/log/nginx/access.log",
      "category": "365_aws_ec2"
    },
    {
      "sourceType": "LocalFile",
      "name": "nginx error",
      "pathExpression": "/var/log/nginx/error.log",
      "category": "365_aws_ec2"
    }?
  ]
}



via rotwar

No comments:

Post a Comment