diff --git a/.gitignore b/.gitignore index 9c0ba151..a886fd12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /.idea /build +/bin .DS_Store /protologbeat /protologbeat.test diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..6c9a2081 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ + +### Version 0.1.1 +- Added Dockerfile and seperate `protologbeat-docker.yml` config file to be used by docker image +- Updated default `protologbeat.yml` to have bare-minimum config values +- Added `build-bin.sh` build script to simplify compiling the binary for the most common platforms \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c269a7cf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM node:6-alpine + +# Misc +LABEL Description="Protologbeat Docker image based on Alpine" Vendor="Alain Lefebvre" +MAINTAINER Alain Lefebvre + +#RUN apk update && \ +# apk upgrade && \ +# apk add curl + +ARG version +ENV VERSION=$version + +RUN set -ex ;\ + # Ensure kibana user exists + addgroup -S protologbeat && adduser -S -G protologbeat protologbeat ;\ + # Install dependencies + apk --no-cache add bash fontconfig gettext su-exec tini curl ;\ + # Fix permissions + mkdir -p /opt/protologbeat/conf && mkdir -p /opt/protologbeat/ssl + +RUN curl -Lso - https://github.com/hartfordfive/protologbeat/releases/download/${VERSION}/protologbeat-${VERSION}-linux-x86_64.tar.gz | \ + tar zxf - -C /tmp && \ + cp /tmp/protologbeat-${VERSION}-linux-x86_64 /opt/protologbeat/protologbeat +# cp /tmp/protologbeat-0.1.0-linux-x86_64 /usr/share/protologbeat + +ENV PATH=/opt/protologbeat:$PATH + +COPY protologbeat-docker.yml /opt/protologbeat/conf/protologbeat.yml +COPY protologbeat.template-es2x.json /opt/protologbeat +COPY protologbeat.template.json /opt/protologbeat + +RUN chown -R protologbeat:protologbeat /opt/protologbeat ;\ + chmod 750 /opt/protologbeat ;\ + chmod 700 /opt/protologbeat/ssl + +WORKDIR /opt/protologbeat + + +USER protologbeat + + + + + +CMD ["protologbeat", "-e", "-c", "/opt/protologbeat/conf/protologbeat.yml"] diff --git a/README.md b/README.md index d9525743..0ab7e2cd 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,14 @@ in the same directory with the name protologbeat. make ``` +If you'd like to build the binary for OSX, Linux and/or Windows, you can run the following: + +``` +./build-bin [TAG_VERSION] +``` + +The resulting binaries will be placed in the `bin/` directory + ### Run diff --git a/protologbeat-docker.yml b/protologbeat-docker.yml new file mode 100644 index 00000000..2b8cc275 --- /dev/null +++ b/protologbeat-docker.yml @@ -0,0 +1,70 @@ +################### Protologbeat Configuration Example ######################### + +############################# Protologbeat ###################################### + +protologbeat: + address: ${ADDRESS:0.0.0.0} + port: ${PORT:6000} + protocol: ${PROTOCOL:udp} + max_msg_size: ${MAX_MSG_SIZE:4096} + default_es_log_type: ${DEFAULT_ES_TYPE:protologbeat} + + +#================================ General ===================================== + +# The name of the shipper that publishes the network data. It can be used to group +# all the transactions sent by a single shipper in the web interface. +#name: + +# The tags of the shipper are included in their own field with each +# transaction published. +#tags: ["service-X", "web-tier"] + +# Optional fields that you can specify to add additional information to the +# output. +#fields: +# env: staging + +#================================ Outputs ===================================== + +# Configure what outputs to use when sending the data collected by the beat. +# Multiple outputs may be used. +output.console: + enabled: ${CONSOLE_OUTPUT_ENABED:false} + pretty: true + +#-------------------------- Elasticsearch output ------------------------------ +output.elasticsearch: + # Array of hosts to connect to. + hosts: ["${ES_HOST:127.0.0.1}:${ES_PORT:9200}"] + + # Optional protocol and basic auth credentials. + #protocol: "https" + #username: "elastic" + #password: "changeme" + +#----------------------------- Logstash output -------------------------------- +#output.logstash: + # The Logstash hosts + #hosts: ["localhost:5044"] + + # Optional SSL. By default is off. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + +#================================ Logging ===================================== + +# Sets log level. The default log level is info. +# Available log levels are: critical, error, warning, info, debug +#logging.level: debug + +# At debug level, you can selectively enable logging only for some components. +# To enable all selectors use ["*"]. Examples of other selectors are "beat", +# "publish", "service". +#logging.selectors: ["*"] diff --git a/protologbeat.yml b/protologbeat.yml index e4a76e32..2b4a092b 100644 --- a/protologbeat.yml +++ b/protologbeat.yml @@ -7,16 +7,7 @@ protologbeat: port: 6000 protocol: udp max_msg_size: 4096 - json_mode: true default_es_log_type: protologbeat - merge_fields_to_root: true - enable_syslog_format_only: false - enable_json_validation: false - validate_all_json_types: false - json_schema: - email_contact: "/usr/local/go/src/github.com/hartfordfive/protologbeat/_samples/app1_schema.json" - stock_item: "/usr/local/go/src/github.com/hartfordfive/protologbeat/_samples/app2_schema.json" - debug: true #================================ General =====================================