monitor_observer_log.yaml 2.1 KB
Newer Older
O
ob-robot 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
logTailerInput: &logTailerInput
  plugin: logTailerInput
  config:
    timeout: 60s
    pluginConfig:
      tailConfigs:
        -   logDir: ${ob.install.path}/log
            logFileName: observer.log
            processLogInterval: 500ms
            logSourceType: observer
            logAnalyzerType: ob
        -   logDir: ${ob.install.path}/log
            logFileName: election.log
            processLogInterval: 500ms
            logSourceType: election
            logAnalyzerType: ob
        -   logDir: ${ob.install.path}/log
            logFileName: rootservice.log
            processLogInterval: 500ms
            logSourceType: rootservice
            logAnalyzerType: ob
      recoveryConfig:
          enabled: true
          triggerThreshold: 10000

logTransformer: &logTransformer
  plugin: logTransformer
  config:
    timeout: 10s
    pluginConfig:

retagProcessor: &retagProcessor
  plugin: retagProcessor
  config:
    timeout: 10s
    pluginConfig:
      newTags:
        ip: ${monagent.host.ip}
        obClusterId: ${monagent.ob.cluster.id}
        obClusterName: ${monagent.ob.cluster.name}

esOutput: &esOutput
  plugin: esOutput
  config:
    timeout: 10s
    pluginConfig:
      clientAddresses: ${es.client.addresses}
      auth:
        username: ${es.client.auth.username}
        password: ${es.client.auth.password}
      indexNamePattern: ocp_log_%Y%m%d
      batchSizeInBytes: 1048576
      maxBatchWait: 1s
      docMap:
        timestamp: timestamp
        timestampPrecision: 1us
        name: file
        tags:
          level: level
          app: app
        fields:
          content: content
          tags: tags

modules:
  - module: monitor.ob.log
    moduleType: monagent.pipeline
    process: ob_monagent
    config:
      name: ob.log
      status: ${monagent.pipeline.ob.log.status}
      pipelines:
        - name: ob_log_to_es
          config:
            scheduleStrategy: bySource
          structure:
            inputs:
              - <<: *logTailerInput
            processors:
              - <<: *retagProcessor
              - <<: *logTransformer
            output:
              <<: *esOutput