본문 바로가기
Splunk

[splunk] 요약 인덱스

by 앗사비 2025. 2. 19.
728x90

매번 이렇게 검색하면 약 2.5초 소요된다
index="_internal" 
| stats c by component

그러므로 검색 결과를 서머리에 저장했다가
index="_internal" 
| sistats c by component 
| collect index="summary" marker=mytag=haha

호출하면 0.1초만에 완료된다.
index="summary" mytag=haha
| stats c by component 


mytag는 marker 옵션으로 지정한 커스텀 필드명이다
기본 요약 인덱스는 summary 이지만, 별도의 요약 인덱스를 생성 가능.

이벤트의 시간값 필요시 si* 전에 | eval orig_time=_time 넣어서 집계

 


주의 사항이 있다
https://docs.splunk.com/Documentation/Splunk/9.4.0/Knowledge/UseSireportingcommands
si*(summary index) 계열의 명령어로 변환해서 저장 한다 (ex. stats -> sistats)
si* 명령어 이후에 다른 검색 연산자를 사용하지 않는다.
기타 등등이 있지만 위 2개가 중요


웹ui로도 구성 가능하다
https://docs.splunk.com/Documentation/Splunk/9.4.0/Knowledge/Usesummaryindexing
*새 보고서 > 검색 : index="_internal" | sistats c by component 
*만들어진 보고서 편집 메뉴 > 요약 인덱싱 편집
  - 요약 인덱스 선택 : summary 선택
  - 필드 추가 : mytag = haha

728x90