전체 글(1104)
-
Dev Tools로 Transfrom 만들기
미리보기POST _transform/_preview{ "dest": { "index": "plant-daily-stats" }, "frequency": "15m", "sync": { "time": { "field": "@timestamp", "delay": "60s" } }, "description": "일 단위 통계 + 표준편차/결측률 (8.14 호환)", "source": { "index": ["plant-topic-*"], "runtime_mappings": { "temperature_sq": { "type": "double", "script": { "source": "if (doc.containsKey('temperature') && !do..
2025.08.17 -
Kibana UI로 새 Transform 만들기
절차Kibana → Stack Management → Transforms기존 Transform (sensor_daily_stats_v1) 우측 … (Actions) 메뉴 → Clone 선택Clone 화면에서:Group by는 그대로 (sensor_id, @timestamp → day)Aggregations 단계에서 추가:Value count (데이터 건수)Avg + Std deviation (변동성)Top metrics → temp/humid asc/desc (첫값/마지막값)Destination index는 새 이름 (예: sensor-daily-stats-v2)Transform ID도 새로 (sensor_daily_stats_v2)Review → Create and startJSON 예시PUT _tra..
2025.08.17 -
kafka consumer용 계정 생성
Kibana UI 절차Management → Stack Management → Security → Roles 이동Create role 클릭Index privileges:Indices: node_disk-* (패턴 지정)Privileges: write, create_index)저장Security → Users 이동Create userUsername / Password 입력위에서 만든 Role 선택저장 Kafka Consumer 쪽 설정 app: es: url: https://es-es-http.elastic.svc.cluster.local:9200 username: {계정} password: {비밀번호} 인덱싱 권한 실제 검증(간단 Bulk) curl -u '{계정:비밀번호}' \ -H..
2025.08.16 -
elasticsearch의 index 생성 주기 설정
application.yml app: sink: es: index: policy: ${ES_INDEX_POLICY:daily} # daily | monthly | static | format static-name: ${ES_INDEX_STATIC_NAME:plant-topic} format: ${ES_INDEX_FORMAT:yyyy.MM.dd} # ★ format 모드일 때 사용할 패턴 tz: ${ES_INDEX_TZ:UTC} # ★ 모든 모드 공통 사용 가능 (기본 UTC) IndexNameResolver 패치 package com.hys.kafka.es;impor..
2025.08.16 -
Kafka에서 지난 데이터 전송하기
전체 처음부터 재처리: 작동중인 아무 broker에서 실행해도 됨# 컨슈머 중지 후 실행kafka-consumer-groups.sh \ --bootstrap-server \ --group \ --topic [,...] \ --reset-offsets --to-earliest --execute 특정 시점부터 재처리 # 예: 2025-08-10 00:00(+09:00) 이후만 다시 읽기kafka-consumer-groups.sh \ --bootstrap-server \ --group \ --topic \ --reset-offsets --to-datetime 2025-08-10T00:00:00+09:00 --execute 범위/개수 기준으로 재처리# 최근 7일치만 다시 읽기kafka-c..
2025.08.16 -
Index Template 삭제
삭제시 에러가 나는 경우 Data Stream이 존재하는지 확인해야 함# Dev Tools 에서 실행DELETE _index_template/# 에러# data stream에서 사용중이라 삭제가 안됨{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "unable to remove composable templates [plant-topic-template] as they are in use by a data streams [plant-topic-2025.08.16]" } ], "type": "illegal_argument_exception", "reason": "unable to remove composable t..
2025.08.16