> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/search/data-explorer/example-queries.md).

# 데이터 탐색기 SQL 검색 예시

## 개요

이 예제들은 Panther Console에서 Data Explorer를 사용하여 Security Data Lake 내의 데이터를 활용해 조사하고 질문에 답하는 방법을 보여줍니다.

Snowflake 환경에서의 구문 및 문장 사용법 예시는 다음을 참조하세요: [Snowflake 문서: SQL Command Reference](https://docs.snowflake.com/en/sql-reference-commands.html) 및 [반구조화된 데이터 쿼리.](https://docs.snowflake.com/en/user-guide/querying-semistructured.html)

이 페이지의 예시는 모든 로그 유형에 적용되며, 하위 페이지에는 특정 로그 유형에 적용되는 예시가 포함되어 있습니다:

* [VPC Flow 로그](/ko/search/data-explorer/example-queries/vpc-flow-logs-queries.md)
* [CloudTrail 로그](/ko/search/data-explorer/example-queries/cloudtrail-logs-queries.md)
* [GuardDuty 로그](/ko/search/data-explorer/example-queries/guardduty-logs-queries.md)
* [S3 액세스 로그](/ko/search/data-explorer/example-queries/s3-access-logs-queries.md)
* [NGINX 및 ALB 액세스 로그](/ko/search/data-explorer/example-queries/nginx-and-alb-access-logs-queries.md)
* [GitHub 감사 로그](/ko/search/data-explorer/example-queries/github-audit-logs-queries.md)

### 고려 사항

모든 쿼리는 결과 크기를 제어해야 합니다. 이는 다음을 사용해 수행할 수 있습니다: `LIMIT` 또는 `GROUP BY` 절.

## 이 IP 주소가 내 네트워크에서 어떤 활동을 했나요(그리고 어떤 로그에 기록되었나요)?

이것은 조사에서 가장 먼저 묻는 질문 중 하나인 경우가 많습니다. IP 주소와 같은 알려진 악성 지표가 있다면, 네트워크/시스템에서 관련 활동이 있는지 확인한 후 상세 조사가 필요합니다.

Snowflake의 `contains` 메서드는 데이터에 대한 부분 일치로 사용할 수 있으며, Snowflake의 `array_contains` 메서드는 해당 데이터에 대해 정확히 일치해야 합니다.

아래 예시에서는 Panther 필드 `p_any_ip_addresses` 가 사용됩니다. Panther는 모든 데이터 소스에서 여러 공통 지표 필드를 표준 필드로 추출합니다(참조 [Panther 필드](/ko/search/panther-fields.md)).

```sql
SELECT
 p_log_type, count(1) AS row_count
FROM panther_views.public.all_logs
WHERE p_occurs_between('2021-01-01', '2021-01-02')
     AND array_contains('95.123.145.92'::variant, p_any_ip_addresses)
GROUP BY p_log_type
LIMIT 100
```

## 모든 로그에서 행 수 기준 상위 10개 IP는 무엇인가요?

활동을 순위화(상위 또는 하위)하는 것은 네트워크를 파악하는 데 유용한 기법입니다. 상위 순위 활동은 DDoS 공격에 연루된 IP 주소를 찾는 데 도움이 될 수 있고, 하위 순위(ORDER BY를 ASC로 변경)는 은밀한 활동을 드러낼 수 있습니다.

```sql
SELECT
  ip.value as ip,
  count(1) as total_rows
FROM panther_views.public.all_logs, LATERAL FLATTEN(input => p_any_ip_addresses) ip
WHERE p_occurs_between('2021-01-01', '2021-01-02')
GROUP BY ip.value
ORDER BY  total_rows DESC
LIMIT 100
```

## 모든 로그에서 로그 유형 수 기준 상위 10개 IP는 무엇인가요?

이는 위 쿼리의 변형으로, IP가 활동을 보이는 데이터 소스의 수로 IP를 순위화합니다. 이를 통해 해당 IP 주소가 모든 시스템에 걸쳐 어느 정도의 '도달 범위'를 가지는지 확인할 수 있습니다.

```sql
SELECT
  ip,
  count(distinct p_log_type) as datasets
FROM
(
SELECT
  p_log_type,
  ip. value as ip
FROM panther_views.public.all_logs, LATERAL FLATTEN(input => p_any_ip_addresses) ip
WHERE p_occurs_between('2021-01-01', '2021-01-02')
GROUP BY ip.value, p_log_type
)
GROUP BY ip
ORDER BY  datasets DESC
LIMIT 100
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/ko/search/data-explorer/example-queries.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
