Commit 4a7bfddc authored by Matt Pryor's avatar Matt Pryor
Browse files

Logstash image working

parent efbbdbc7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -95,6 +95,13 @@ build:jre:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/jre
  needs: ["build:base"]

build:logstash:
  extends: .docker-build
  stage: build-2
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/logstash
  needs: ["build:base"]

build:rsync:
  extends: .docker-build
  stage: build-2
+28 −0
Original line number Diff line number Diff line
#####
## Image containing logstash
##
## It is used to send usage logs to the log aggregator operated by CMCC
#####

ARG ESGF_REPOSITORY_BASE=esgfdeploy
ARG ESGF_IMAGES_VERSION=latest
FROM ${ESGF_REPOSITORY_BASE}/base:${ESGF_IMAGES_VERSION}

USER root

# Add the logstash bin directory to the path
ENV PATH $PATH:/usr/share/logstash/bin
ENV LS_HOME /usr/share/logstash
ENV LS_SETTINGS_DIR /etc/logstash

# Use Elastic's RPM repository to install logstash
COPY logstash.repo /etc/yum.repos.d/logstash.repo
RUN yum makecache && \
    yum install -y logstash-7.10.0 && \
    yum clean all

# Install configuration files
COPY conf/* /etc/logstash/

USER $ESGF_UID
CMD ["logstash"]
+81 −0
Original line number Diff line number Diff line
## JVM configuration

# Remove the Xmx and Xms settings and replace with container support settings
# This means that the heap memory will be based on the container cgroups
-XX:+UseContainerSupport
-XX:MaxRAMPercentage=80.0

################################################################
## Expert settings
################################################################
##
## All settings below this section are considered
## expert settings. Don't tamper with them unless
## you understand what you are doing
##
################################################################

## GC configuration
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly

## Locale
# Set the locale language
#-Duser.language=en

# Set the locale country
#-Duser.country=US

# Set the locale variant, if any
#-Duser.variant=

## basic

# set the I/O temp directory
# Set tmpdir to something other than /tmp, as it seems to cause issues with read-only root fs on Kubernetes
-Djava.io.tmpdir=/tmp/logstash

# set to headless, just in case
-Djava.awt.headless=true

# ensure UTF-8 encoding by default (e.g. filenames)
-Dfile.encoding=UTF-8

# use our provided JNA always versus the system one
#-Djna.nosys=true

# Turn on JRuby invokedynamic
-Djruby.compile.invokedynamic=true
# Force Compilation
-Djruby.jit.threshold=0
# Make sure joni regexp interruptability is enabled
-Djruby.regexp.interruptible=true

## heap dumps

# generate a heap dump when an allocation from the Java heap fails
# heap dumps are created in the working directory of the JVM
-XX:+HeapDumpOnOutOfMemoryError

# specify an alternative path for heap dumps
# ensure the directory exists and has sufficient space
#-XX:HeapDumpPath=${LOGSTASH_HOME}/heapdump.hprof

## GC logging
#-XX:+PrintGCDetails
#-XX:+PrintGCTimeStamps
#-XX:+PrintGCDateStamps
#-XX:+PrintClassHistogram
#-XX:+PrintTenuringDistribution
#-XX:+PrintGCApplicationStoppedTime

# log GC status to a file with time stamps
# ensure the directory exists
#-Xloggc:${LS_GC_LOG_FILE}

# Entropy source for randomness
-Djava.security.egd=file:/dev/urandom

# Copy the logging context from parent threads to children
-Dlog4j2.isThreadContextMapInheritable=true
+20 −0
Original line number Diff line number Diff line
#####
# Configure log4j2 to send all logs to the console
#####

status = error
name = LogstashPropertiesConfig

appender.console.type = Console
appender.console.name = plain_console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c]%notEmpty{[%X{pipeline.id}]}%notEmpty{[%X{plugin.id}]} %m%n

appender.json_console.type = Console
appender.json_console.name = json_console
appender.json_console.layout.type = JSONLayout
appender.json_console.layout.compact = true
appender.json_console.layout.eventEol = true

rootLogger.level = ${sys:ls.log.level}
rootLogger.appenderRef.console.ref = ${sys:ls.log.format}_console
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
http.host: "0.0.0.0"
Loading