Skip to content

Commit

Permalink
fix: newline 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seokhongkim committed Jul 24, 2023
1 parent 3896ced commit 62ab1fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/.ebextensions/02-set-filebeat.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"files": {
"/tmp/make_filebeat_yml.sh": {
"mode": "000755",
"content": "#!/bin/bash\nPASSWORD=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PASSWORD)\nHOST=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_HOST)\nPORT=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PORT)\nUSER=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_USER)\ncat > /home/ec2-user/filebeat-7.14.1-linux-x86_64/filebeat.yml <<EOF\nfilebeat.inputs:\n- type: log\n enabled: true\n paths:\n - /var/app/current/logs/info/info.log\n - /var/app/current/logs/error/error.log\n - /var/app/current/logs/warn/*.log\n fields:\n log_type: legacy-log\n- type: log\n enabled: true\n paths:\n - /var/log/nginx/access.log\n fields:\n log_type: access-log\noutput.elasticsearch:\n hosts: [\"$HOST:$PORT\"]\n username: \"$USER\"\n password: \"$PASSWORD\"\n indices:\n - index: \"filebeat-%{[agent.version]}-access-log\"\n when.equals:\n fields.log_type: \"access-log\"\n - index: \"filebeat-%{[agent.version]}-legacy-log\"\n when.equals:\n fields.log_type: \"legacy-log\"\nEOF"
"content": "#!/bin/bash\nPASSWORD=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PASSWORD)\nHOST=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_HOST)\nPORT=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PORT)\nUSER=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_USER)\ncat > /home/ec2-user/filebeat-7.14.1-linux-x86_64/filebeat.yml <<EOF\nfilebeat.inputs:\n- type: log\n enabled: true\n paths:\n - /var/app/current/logs/info/info.log\n - /var/app/current/logs/error/error.log\n - /var/app/current/logs/warn/*.log\n fields:\n log_type: legacy-log\n- type: log\n enabled: true\n paths:\n - /var/log/nginx/access.log\n fields:\n log_type: access-log\noutput.elasticsearch:\n hosts: [\"$HOST:$PORT\"]\n username: \"$USER\"\n password: \"$PASSWORD\"\n indices:\n - index: \"filebeat-%{[agent.version]}-access-log\"\n when.equals:\n fields.log_type: \"access-log\"\n - index: \"filebeat-%{[agent.version]}-legacy-log\"\n when.equals:\n fields.log_type: \"legacy-log\"\nEOF\n"
},
"/tmp/install_filebeat.sh": {
"mode": "000755",
"content": "#!/bin/bash\nFILEBEAT_DIRECTORY=\"/home/ec2-user/filebeat-7.14.1-linux-x86_64\"\nif [ ! -d \"$FILEBEAT_DIRECTORY\" ]; then\n wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.14.1-linux-x86_64.tar.gz\n tar xzvf filebeat-7.14.1-linux-x86_64.tar.gz\nelse\n echo \"Filebeat already installed.\"\nfi"
"content": "#!/bin/bash\nFILEBEAT_DIRECTORY=\"/home/ec2-user/filebeat-7.14.1-linux-x86_64\"\nif [ ! -d \"$FILEBEAT_DIRECTORY\" ]; then\n wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.14.1-linux-x86_64.tar.gz\n tar xzvf filebeat-7.14.1-linux-x86_64.tar.gz\nelse\n echo \"Filebeat already installed.\"\nfi\n"
},
"/tmp/restart_filebeat.sh": {
"mode": "000755",
"content": "#!/bin/bash\n\nPID=$(ps -ef | grep ./filebeat | grep -v grep | awk '{print $2}')\n\nif [[ -n \"$PID\" ]]; then\n echo \"Filebeat PID : $PID\"\n sudo kill -9 $PID\nelse\n echo \"Filebeat is not running.\"\nfi\n\necho \"Restarting Filebeat\"\ncd filebeat-7.14.1-linux-x86_64 && sudo chmod 644 filebeat.yml && nohup ./filebeat -e > filebeat.log 2>&1 &\ndisown\necho \"Filebeat restarted\""
"content": "#!/bin/bash\n\nPID=$(ps -ef | grep ./filebeat | grep -v grep | awk '{print $2}')\n\nif [[ -n \"$PID\" ]]; then\n echo \"Filebeat PID : $PID\"\n sudo kill -9 $PID\nelse\n echo \"Filebeat is not running.\"\nfi\n\necho \"Restarting Filebeat\"\ncd filebeat-7.14.1-linux-x86_64 && sudo chmod 644 filebeat.yml && nohup ./filebeat -e > filebeat.log 2>&1 &\ndisown\necho \"Filebeat restarted\"\n"
}
},
"commands": {
Expand Down

0 comments on commit 62ab1fe

Please sign in to comment.