본문 바로가기

Splunk14

스플렁크 대시보드에서 html 사용 원본 편집모드 > 패널 태그 안에 html 태그 사용하면 됨 hi  https://docs.splunk.com/Documentation/Splunk/9.4.0/Viz/PanelreferenceforSimplifiedXML#html 2025. 2. 13.
splunk start 옵션 splunk help 커맨드 출력 내용 정리함/opt/splunk/bin/splunk help start  --accept-license최초 실행 시 라이선스를 자동으로 수락하고 진행함.--answer-yes설치 및 업그레이드 시 모든 확인 요청에 자동으로 "예(yes)"로 응답함.--debugVerbose(상세) 로깅 모드로 실행함.권장되지 않음--no-prompt입력 대기 없이 질문이 발생하면 바로 종료함.--seed-passwd 설치 시 관리자(admin) 비밀번호를 설정함.단, etc/passwd 파일이나 user-seed.conf 파일이 존재하면 무시됨.주의: 비밀번호가 프로세스 목록과 명령어 기록에 노출될 수 있음.--gen-and-print-passwd무작위(admin) 비밀번호를 생성하고 .. 2025. 2. 3.
스플렁크 자동 설치 스크립트 #!/bin/bash# 권한 추가# chmod +x splunk_install.shSPLUNK_URL="https://download.splunk.com/products/splunk/releases/9.4.0/linux/splunk-9.4.0-6b4ebe426ca6-linux-amd64.tgz"SPLUNK_HOME="/opt/splunk"ID="admin"PW="12345678"# 다운로드wget -O /tmp/splunk.tgz $SPLUNK_URL# 압축 해제tar xvzf /tmp/splunk.tgz -C /opt# user-seed.conf 파일 설정cat $SPLUNK_HOME/etc/system/local/user-seed.conf[user_info]USERNAME = $IDPASSWORD .. 2025. 1. 21.
리눅스에 스플렁크 설치 환경 구축윈도우인 경우 WSL, VMware 등으로 리눅스 가상 환경 구축설치 준비스플렁크 홈페이지 회원가입리눅스 .tgz 다운로드 : https://www.splunk.com/en_us/download/splunk-enterprise.html공식 가이드 : https://www.youtube.com/watch?v=FfY8C60yTcUsudo 권한 사용설치 진행opt 경로에 압축 풀기 tar xvzf [splunk_package_name].tgz -C /opt스플렁크 실행 cd /opt/splunk/bin ./splunk start --accept-license부팅 후 자동 시작 등록 ./splunk enable boot-start옵션스플렁크 환경 변수 등록 nano ~/.bashrc export S.. 2025. 1. 13.
stats vs sistats vs tstats vs mstats vs eventstats vs streamstats stats: 모든 상황에서 사용 가능sistats: 요약 인덱스에서 최적화tstats: 시계열 데이터에서 최적화mstats : 메트릭 데이터에서 최적화eventstats: 일괄 통계값streamstats : 누적 통계값 * gpt 비유로 eventstats 와 streamstats 설명한 마을에 두 명의 통계 마법사가 있었어요. 하나는 일괄 통계 마법사, 다른 하나는 누적 통계 마법사였죠.일괄 통계 마법사는 마을 사람들이 했던 일을 한 번에 모두 모아서 계산했어요. 예를 들어, "지난 주 동안 사람들이 마신 물의 양은 총 1000리터였어요!" 이렇게요. 모든 데이터를 모아 한 번에 결과를 알려주는 거죠.반면, 누적 통계 마법사는 매일 데이터를 모아서 그때그때마다 결과를 업데이트했어요. 예를 들어, "오늘.. 2025. 1. 10.
[tip] 분산 명령어를 먼저 사용하라 a)index=main sourcetype=access_combined_wcookie| stats count by clientip| rename clientip as sourceIp| table sourceIp, countb)index=main sourcetype=access_combined_wcookie| rename clientip as sourceIp| stats count by sourceIp| table sourceIp, count 스플렁크 블로그를 보다가 알게됨명령어 순서만 다를 뿐인데 b가 a보다 더 빠름rename이 분산형이라 그렇다  명령어의 스트리밍 유형에 따른 차이  스트리밍분산 : ex. rename중앙 : ex. head비스트리밍 : ex. sort스트리밍 분산형 먼저 처리 후 사.. 2025. 1. 10.
[splunk] 리텐션 - 월별 코호트 https://docs.holistics.io/docs/charts/cohort-retention샘플로 아래와 같은 데이터가 있다고 하자reg_dateuser_cntv1v2v3v4v5v6v7v8v9v10v11v122024-01-03300120908073645551000002024-01-0420013011510290827871000002024-01-051901201009286707160000002024-01-06180119108958575606300000 reg_date는 구독한 날이고 user_cnt는 해당 일의 신규 구독자 수다v1~v12는 신규 구독자가 n개월 후 몇명 잔류했는지의 수치다30일 간격으로 측정| eval reg_date=strptime(reg_date, "%Y-%m-%d") | eval.. 2024. 8. 21.
스플렁크 30일 간격 리스트 만들기 (makeresults) | makeresults count=12 | streamstats count AS row | eval mydate=strptime("2024-07-22", "%Y-%m-%d") | eval date=strftime(relative_time(mydate, "+" . (row - 1) * 30 . "d"), "%Y-%m-%d") | table date | sort + date 2024. 7. 22.
스플렁크로 리텐션 구하기 | multisearch [ search index="log_pd_com" uri_path=/pd/install earliest=-22d@d latest=-21d@d | eval type="install" ] [ search index="log_pd_com" uri_path=/pd/playing earliest=-21d@d latest=-14d@d | eval type="section_1" ] [ search index="log_pd_com" uri_path=/pd/playing earliest=-14d@d latest=-7d@d | eval type="section_2" ] [ search index="log_pd_com" uri_path=/pd/playing earliest=-7d@d latest=-.. 2024. 2. 14.