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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,036评论 6 506
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,046评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,411评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,622评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,661评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,521评论 1 304
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,288评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,200评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,644评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,837评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,953评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,673评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,281评论 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,889评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,011评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,119评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,901评论 2 355

推荐阅读更多精彩内容