~mevers/charms/trusty/logstash/inputTcp

« back to all changes in this revision

Viewing changes to hooks/input-tcp-relation-changed

  • Committer: Martijn Evers
  • Date: 2015-10-05 12:54:52 UTC
  • Revision ID: martijn4evers@gmail.com-20151005125452-ydqfqygliukr39ng
Added input-tcp (port 9999) relation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -eux
 
4
 
 
5
hostname=$(unit-get private-address)
 
6
juju-log "input-tcp-relation-joined/changed, setting port: 9999"
 
7
relation-set port=9999 hostname=$hostname
 
8
 
 
9
basePath=/opt/logstash
 
10
configPath=${basePath}/conf.d
 
11
 
 
12
echo -e 'input {\n\ttcp {\n\t\tport => 9999\n\t\tcodec => "json"\n\t}\n}' > ${configPath}/input-tcp.conf
 
13
 
 
14
if [ "$(service logstash-indexer status | grep running)" ]; then
 
15
    service logstash-indexer restart
 
16
fi