vector logging

2025. 1. 7. 17:35·CloudNative/Observability & Analysis

 

vector docs

https://vector.dev/docs/about/vector/

 

Vector

Sign up to receive emails on the latest Vector content and new releases ×

vector.dev

 

EFK 구성

log pipeline

  • vector -> data-prepper -> opensearch

role

  • vector:  log 수집
  • data-prepper: log 가공
  • opensearch: 저장 및 시각화

YAML

vector

kind: Deployment
apiVersion: apps/v1
metadata:
  name: tomcat
  labels:
    app: tomcat
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tomcat
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: tomcat
        deployment: tomcat
    spec:
      volumes:
        - name: app-logs
          emptyDir: {} # 로그 볼륨은 emptyDir로 한다.
        - name: vector-config
          configMap:
            name: vector-config
            defaultMode: 420
      containers:
        - name: tomcat
          image: >-
            docker.io/mooneyred/tomcat:latest
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          volumeMounts:
            - name: app-logs # vector와 공유할 로그 볼륨
              mountPath: /usr/local/tomcat/logs
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
        - resources: {}
          terminationMessagePath: /dev/termination-log
          name: vector
          env:
            - name: VECTOR_LOG
              value: info
          imagePullPolicy: Always
          volumeMounts:
            - name: app-logs
              mountPath: /usr/local/tomcat/logs
            - name: vector-config
              readOnly: true
              mountPath: /etc/vector
          terminationMessagePolicy: File
          image: 'timberio/vector:0.43.1-alpine'
          args:
            - '--config'
            - /etc/vector/vector.toml
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%

 

kind: ConfigMap
apiVersion: v1
metadata:
  name: vector-config
data:
  vector.toml: |
    [sources.tomcat_logs]
    type = "file"
    include = ["/usr/local/tomcat/logs/*.log"] 
    ignore_older = 86400 
    fingerprint.strategy = "checksum"

    [transforms.json_parser]
    type = "remap"
    inputs = ["tomcat_logs"]
    source = '''
    . = parse_json!(.message)
    '''

    [sinks.data-prepper]
    inputs = ["json_parser"]
    type = "http"
    encoding.codec = "json"
    uri = "http://data-prepper-headless:21891/vector/ingest"

 

data-prepper

data-prepper configmap 에서 pipelines.yaml 에 아래내용 추가

vector-pipeline:
  source:
    http:
      path: "/vector/ingest"
      port: 21891

  sink:
    - opensearch:
        hosts: ["http://opensearch:9200"]
        index: vector
        index_type: custom
        bulk_size: 200
    - stdout:

 

728x90

'CloudNative > Observability & Analysis' 카테고리의 다른 글

pinpoint agentid 환경변수 처리  (0) 2025.01.14
scouter  (0) 2025.01.10
pinpoint plugin config  (2) 2024.11.24
otel  (0) 2024.11.22
kubecost  (2) 2024.11.11
'CloudNative/Observability & Analysis' 카테고리의 다른 글
  • pinpoint agentid 환경변수 처리
  • scouter
  • pinpoint plugin config
  • otel
yunapapa
yunapapa
working on the cloud
    250x250
  • yunapapa
    supermoon
    yunapapa
  • 전체
    오늘
    어제
    • 분류 전체보기 (94)
      • 개발 (20)
        • java (17)
        • web (2)
        • MSX (1)
        • Go (0)
      • CloudNative (50)
        • App Definition & Developeme.. (17)
        • Orchestration & Management (4)
        • Runtime (3)
        • Provisioning (7)
        • Observability & Analysis (14)
        • event review (5)
      • AWS (7)
      • 환경관련 (17)
      • 취미생활 (0)
        • 맛집 (0)
        • 게임 (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • CNCF Past Events
    • Kubernetes Korea Group
  • 공지사항

  • 인기 글

  • 태그

    Java
    helm
    티스토리챌린지
    gitlab
    오블완
    dop-c02
    OpenShift
    APM
    k8s
    devops
    springboot
    AWS
    Pinpoint
    kubernetes
    istio
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
yunapapa
vector logging
상단으로

티스토리툴바