最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

logging - Parse logs with opentelemetry collector - Stack Overflow

programmeradmin1浏览0评论

Im trying parse logs received in my opentelemetry collector from one application in spring boot using logback by grpc with otlp protoco and finally send to elasticsearch by collector opentelemetry-collector-contrib:0.117.0

My intention is from this example log:

2025-02-26T09:00:13.611503606+01:00 DEBUG [2025-02-26 09:00:13,610] [.springframework.kafka.KafkaListenerEndpointContainer#15-0-C-1] [] [UpdateSettingsListener] Handling command UpdateSettingsMessage[**context=SAAI-egypt**, additional={interval_canceled=20, booking_status=[1, 3], api_keys=[api-key], last_fetch_date=2025-02-26T08:00:03.985Z, date_filter_mode=3, interval_active=10}], received at 1740556813610

I've tried all types of processors: transform, text, etc but nothing works...

Extract a new field "context" with dynamic value in every log for output in elasticsearch:

Desired result:

{
  "_index": ".ds-dvlp-op-ci-bin-log-2025.02.25-000062",
  "_id": "0nfqQZUBuQEk-wxXPD8h",
  "_version": 1,
  "_score": 0,
  "_source": {
    "@timestamp": "2025-02-26T11:00:08.839000000Z",
    "Body": "Command: UpdateAdditionalSettings[lastFetchDate=2025-02-26T11:00:01.973Z, context=SAAI-egypt] executed at 1740567608839",
  "context": SAAI-egypt
}
发布评论

评论列表(0)

  1. 暂无评论