1. WAF에서 특정 로그 생성 여부 확인

 

AzureDiagnostics
| where Category == "ApplicationGatewayFirewallLog"
| where hostname_s  == "test.testcom.com"
| where action_s == "Matched" or action_s == "Blocked"
| sort by TimeGenerated

 

2. CDN에서 정보 조회

AzureDiagnostics 
| sort by TimeGenerated   
| project format_datetime(datetime_add('hour', 9, TimeGenerated), 'yyyyMMddHHmm'), Category, clientIp_s, requestUri_s, cacheStatus_s

 

-- sort by  TimeGenerated   : 시간순으로 정렬

-- project   컬럼들 : 컬럼들을 가지고 와서 가공 처리하여 표시

-- format_datetime : 시간을 다른 형식으로 표시

-- datetime_add : UTC 에 +9를 추가하여 표시

 

 

AzureDiagnostics | distinct clientIp_s, requestUri_s, cacheStatus_s

-- distinct  컬럼들 : 해당 컬럼들에 unique 한 값을 가지고 와서 표시

 

let cutoff = ago(24h);    -- 변수를 지정 (시간전 시간 지정)

AzureDiagnostics
| where TimeGenerated > cutoff       -- 변수를 사용하여 쿼리 진행
| where cacheStatus_s == "MISS"
| where Category == "AzureCdnAccessLog"
| summarize count() by format_datetime(TimeGenerated, 'yyyy-MM-dd hh');

 

AzureDiagnostics | take 10        -- 10개 row만 가져 오기

AzureDiagnostics | 

 

 

Kusto참고 페이지 :  https://docs.microsoft.com/ko-kr/azure/data-explorer/kusto/query/best-practices

'cloud > azure' 카테고리의 다른 글

azure cloud terraform 구성  (0) 2022.08.10
azure cloud 기본 구조  (0) 2022.08.10
테라폼 mysql for azure flexible db 생성  (0) 2022.05.30
테라폼 반복문 및 조건문  (0) 2022.03.22
proxysql in azure  (0) 2022.02.09

+ Recent posts