Splunk20 리눅스에 스플렁크 설치 환경 구축윈도우인 경우 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. 스플렁크에서 nps 계산하는 쿼리 https://channel.io/ko/blog/nps_basic 수많은 기업에서 선택한 NPS 알아보기 - 기본편 고객 만족도 지표 고민 중이신가요? 최근 많은 글로벌 기업에서 선택한 NPS의 개념 및 계산 방법부터 장,단점까지 알아보도록 해요. channel.io index="log_test_com" uri_path IN (/test/nps) | stats count by _time, uuid, point | sort - _time `comment("최신 응답이 최상단")` | streamstats count as response_number by uuid `comment("동일 유저의 여러 개 응답에 넘버링")` | where response_number=1 `comment("최신 응답만 필터링").. 2024. 1. 25. 스플렁크 join 대체 https://community.splunk.com/t5/Splunk-Search/Alternative-method-to-using-Join-command/m-p/532978join은 느리고 결과값 개수가 제한되어 권장되지 않는다 --- 다음 두가지는 결과가 동일하다 join 방식index="log_pd_com" uri_path IN (/pd/install) | stats dc(clientip) as inst_device by clientip | join type=left clientip [ search index="log_pd_com" uri_path IN (/pd/uninstall) | stats dc(clientip) as uninst_device by clientip] join .. 2024. 1. 22. 스플렁크 서브서치 mylookup.csv 테이블 구조 user_id,username,email 1,user1,user1@example.com 2,user2,user2@example.com 3,user3,user3@example.com 쿼리 a처럼 작성하면 b와 같이 실행된다 쿼리a index=your_index [| inputlookup mylookup | table username ] | stats count 쿼리b index=your_index (username=user1 OR username=user2 OR username=user3) | stats count 2023. 12. 18. 이전 1 2 3 다음