k8s-logstash

input { rabbitmq { host => "rabbitmq" port => "5672" user => "admin" password => "xxxxxxxx" queue => "logstash" durable => true subscription_retry_interval_seconds => 5 }}filter { json { source => "message" }}output { elasticsearch { hosts => ["xxxxxxxxxxxxxxxxxxxx"] user => "elastic" password => "xxxxxxx" index => "%{[profile]}-%{[service]}-%{+YYYY.MM-ww}" template_name => "xl_log" manage_template => false } stdout { codec => rubydebug }}



logstashyml内容

apiVersion: v1

data:

  jvm.options: |-

    ## JVM configuration

    # Xms represents the initial size of total heap space

    # Xmx represents the maximum size of total heap space

    -Xms1g

    -Xmx1g

    ################################################################

    ## 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:+UseParNewGC

    -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

    #-Djava.io.tmpdir=$HOME

    # 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

    ## 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

  log4j2.properties: |-

    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] %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

  logstash.yml: >-

    http.host: "0.0.0.0"

    xpack.monitoring.elasticsearch.url:

    http://es-cn-mp918la4l000cny3g.elasticsearch.aliyuncs.com:9200

    xpack.monitoring.elasticsearch.username: "elastic"

    xpack.monitoring.elasticsearch.password: "Xlpro2019"

    xpack.monitoring.enabled: true

    #config.debug: true

    #log.level: debug

  pipelines.yml: |-

    # This file is where you define your pipelines. You can define multiple.

    # For more information on multiple pipelines, see the documentation:

    #  https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html

    - pipeline.id: main

      path.config: "/usr/share/logstash/pipeline"

  startu.poptions: >-

    ################################################################################

    # These settings are ONLY used by $LS_HOME/bin/system-install to create a

    custom

    # startup script for Logstash and is not used by Logstash itself. It should

    # automagically use the init system (systemd, upstart, sysv, etc.) that your

    # Linux distribution uses.

    #

    # After changing anything here, you need to re-run

    $LS_HOME/bin/system-install

    # as root to push the changes to the init script.

    ################################################################################

    # Override Java location

    #JAVACMD=/usr/bin/java

    # Set a home directory

    LS_HOME=/usr/share/logstash

    # logstash settings directory, the path which contains logstash.yml

    LS_SETTINGS_DIR=/etc/logstash

    # Arguments to pass to logstash

    LS_OPTS="--path.settings ${LS_SETTINGS_DIR}"

    # Arguments to pass to java

    LS_JAVA_OPTS=""

    # pidfiles aren't used the same way for upstart and systemd; this is for

    sysv users.

    LS_PIDFILE=/var/run/logstash.pid

    # user and group id to be invoked as

    LS_USER=logstash

    LS_GROUP=logstash

    # Enable GC logging by uncommenting the appropriate lines in the GC logging

    # section in jvm.options

    LS_GC_LOG_FILE=/var/log/logstash/gc.log

    # Open file limit

    LS_OPEN_FILES=16384

    # Nice level

    LS_NICE=19

    # Change these to have the init script named and described differently

    # This is useful when running multiple instances of Logstash on the same

    # physical box or vm

    SERVICE_NAME="logstash"

    SERVICE_DESCRIPTION="logstash"

    # If you need to run a command or script before launching Logstash, put it

    # between the lines beginning with `read` and `EOM`, and uncomment those

    lines.

    ###

    ## read -r -d '' PRESTART << EOM

    ## EOM

kind: ConfigMap

metadata:

  annotations:

    kubectl.kubernetes.io/last-applied-configuration: >-

      {"apiVersion":"v1","data":{"jvm.options":"## JVM configuration\n\n# Xms

      represents the initial size of total heap space\n# Xmx represents the

      maximum size of total heap

      space\n\n-Xms1g\n-Xmx1g\n\n################################################################\n##

      Expert

      settings\n################################################################\n##\n##

      All settings below this section are considered\n## expert settings. Don't

      tamper with them unless\n## you understand what you are

      doing\n##\n################################################################\n\n##

      GC

      configuration\n-XX:+UseParNewGC\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n\n##

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

      country\n#-Duser.country=US\n\n# Set the locale variant, if

      any\n#-Duser.variant=\n\n## basic\n\n# set the I/O temp

      directory\n#-Djava.io.tmpdir=$HOME\n\n# set to headless, just in

      case\n-Djava.awt.headless=true\n\n# ensure UTF-8 encoding by default (e.g.

      filenames)\n-Dfile.encoding=UTF-8\n\n# use our provided JNA always versus

      the system one\n#-Djna.nosys=true\n\n# Turn on JRuby

      invokedynamic\n-Djruby.compile.invokedynamic=true\n# Force

      Compilation\n-Djruby.jit.threshold=0\n\n## heap dumps\n\n# generate a heap

      dump when an allocation from the Java heap fails\n# heap dumps are created

      in the working directory of the JVM\n-XX:+HeapDumpOnOutOfMemoryError\n\n#

      specify an alternative path for heap dumps\n# ensure the directory exists

      and has sufficient

      space\n#-XX:HeapDumpPath=${LOGSTASH_HOME}/heapdump.hprof\n\n## GC

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

      log GC status to a file with time stamps\n# ensure the directory

      exists\n#-Xloggc:${LS_GC_LOG_FILE}\n\n# Entropy source for

      randomness\n-Djava.security.egd=file:/dev/urandom","log4j2.properties":"status

      = error\nname = LogstashPropertiesConfig\n\nappender.console.type =

      Console\nappender.console.name =

      plain_console\nappender.console.layout.type =

      PatternLayout\nappender.console.layout.pattern =

      [%d{ISO8601}][%-5p][%-25c] %m%n\n\nappender.json_console.type =

      Console\nappender.json_console.name =

      json_console\nappender.json_console.layout.type =

      JSONLayout\nappender.json_console.layout.compact =

      true\nappender.json_console.layout.eventEol = true\n\nrootLogger.level =

      ${sys:ls.log.level}\nrootLogger.appenderRef.console.ref =

      ${sys:ls.log.format}_console","logstash.yml":"http.host:

      \"0.0.0.0\"\nxpack.monitoring.elasticsearch.url:

      http://es-cn-45912geyo000aw6wf.elasticsearch.aliyuncs.com:9200\nxpack.monitoring.elasticsearch.username:

      \"elastic\" \nxpack.monitoring.elasticsearch.password:

      \"9vePfeVH6dReFVTt\"\nxpack.monitoring.enabled: true\n#config.debug:

      true\n#log.level: debug","pipelines.yml":"# This file is where you define

      your pipelines. You can define multiple.\n# For more information on

      multiple pipelines, see the documentation:\n# 

      https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html\n\n-

      pipeline.id: main\n  path.config:

      \"/usr/share/logstash/pipeline\"","startu.poptions":"################################################################################\n#

      These settings are ONLY used by $LS_HOME/bin/system-install to create a

      custom\n# startup script for Logstash and is not used by Logstash itself.

      It should\n# automagically use the init system (systemd, upstart, sysv,

      etc.) that your\n# Linux distribution uses.\n#\n# After changing anything

      here, you need to re-run $LS_HOME/bin/system-install\n# as root to push

      the changes to the init

      script.\n################################################################################\n\n#

      Override Java location\n#JAVACMD=/usr/bin/java\n\n# Set a home

      directory\nLS_HOME=/usr/share/logstash\n\n# logstash settings directory,

      the path which contains logstash.yml\nLS_SETTINGS_DIR=/etc/logstash\n\n#

      Arguments to pass to logstash\nLS_OPTS=\"--path.settings

      ${LS_SETTINGS_DIR}\"\n\n# Arguments to pass to

      java\nLS_JAVA_OPTS=\"\"\n\n# pidfiles aren't used the same way for upstart

      and systemd; this is for sysv

      users.\nLS_PIDFILE=/var/run/logstash.pid\n\n# user and group id to be

      invoked as\nLS_USER=logstash\nLS_GROUP=logstash\n\n# Enable GC logging by

      uncommenting the appropriate lines in the GC logging\n# section in

      jvm.options\nLS_GC_LOG_FILE=/var/log/logstash/gc.log\n\n# Open file

      limit\nLS_OPEN_FILES=16384\n\n# Nice level\nLS_NICE=19\n\n# Change these

      to have the init script named and described differently\n# This is useful

      when running multiple instances of Logstash on the same\n# physical box or

      vm\nSERVICE_NAME=\"logstash\"\nSERVICE_DESCRIPTION=\"logstash\"\n\n# If

      you need to run a command or script before launching Logstash, put it\n#

      between the lines beginning with `read` and `EOM`, and uncomment those

      lines.\n###\n## read -r -d '' PRESTART \u003c\u003c EOM\n##

      EOM"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"logstashyml","namespace":"default"}}

  creationTimestamp: '2019-07-29T12:15:24Z'

  name: logstashyml

  namespace: default

  resourceVersion: '3773741'

  selfLink: /api/v1/namespaces/default/configmaps/logstashyml

  uid: 8b1e1f21-b1fa-11e9-b5ec-e6ec5e606ec5

你可能感兴趣的:(k8s-logstash)