'Splunk/Splunk Search' 카테고리의 글 목록
본문 바로가기

728x90
반응형

Splunk/Splunk Search

(4)
[ Splunk Search : 사용 사례 ] 어제와 오늘 데이터 분 단위로 비교하기 index=os_window earliest=-24h@s latest=-h@s | bin span=10m _time | stats count as today_count by _time | append     [ | search index=os_window earliest=-48h@s latest=-24h@s     | bin span=10m _time     | stats count as yesterday_count by _time]| eval time=strftime(_time, "%T")| stats values(today_count) as today_count values(yesterday_count) as yesterday_count by time| eval today_count=if(isnull..
[ Splunk Search : 사용 사례 ] 생성한 saved search 정보 검색하기 프로젝트 이후에 작성해야 하는 산출물 중에 "시나리오 정의서" 라는 것이 있다. 시나리오를 어떻게 작성했는지에 대해 기술하는 것인데 생성한 시나리오가 한 두 개도 아니고 UI에서 하나 하나 확인하면 화딱지 나니 검색식으로 리스트를 뽑은 후에 간단하게 복붙으로 해결하고 싶을 때 이 방법을 사용한다. 시나리오 정의서는 시나리오 번호 시나리오 제목 시나리오 상세 검색식 설정된 스케쥴 이렇게 다섯가지를 기본으로 작성한다. 사용한 쿼리 | rest /servicesNS/-/search/saved/searches splunk_server=local | rename eai:acl.* as *, action.summary_index.* as * | where app="search" | table title, descr..
[ Splunk Search : 사용 사례 ] splunk command로 가짜 데이터 생성하기 프로젝트를 하다보면 고객사의 상황에 따라 데이터가 많이 없는 경우 검색식이 맞게 작성되었는지 검증하기가 어려운 경우가 있다. 그런 경우 임시 데이터를 직접 splunk command만으로 만들 수가 있다. | makeresults count=30 | bin span=1d _time | streamstats count | eval _time = _time - (count*86400) | fields - count | eval a=round(random()/10000000), username="haley" | eval b=case(a>200,a-200, a>100, a-100, true(), a) | sort - b [ STEP 1 ] makeresults count = 30 다음과 같이 30개의 이벤트가 ..
[ Splunk Search ] 주식 프로젝트에 사용된 명령어 분석하기 🔆 오늘의 목표 🔆 🪨 아래의 배열형 데이터를 독립된 열 데이터로 만들자!! { "Sharpe": 0.49486577087259837, "Returns": 0.09653658218825922, "Risk": 0.19507629719072297, "idx": 999, "code": ["008770.KS", "010620.KS", "011170.KS", "024110.KS", "192820.KS"], "rate": [0.027731564480966874, 0.056647087277405216, 0.5564385158412494, 0.0045145824210048, 0.35466824997937374], "date": "2021-01-11" } 🪨 원하는 결과 index="monte" | head 1 | re..

728x90
반응형