> 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/data-onboarding/data-transports/google/pubsub.md).

# Pub/Sub 소스

## 개요

Panther는 구성을 지원합니다 [Google Pub/Sub](https://cloud.google.com/pubsub?hl=en) 로그 데이터를 Pub/Sub 주제에서 직접 가져오기 위한 Data Transport로.

Panther는 Google Cloud를 사용하여 소스에 대해 인증할 수 있습니다 [Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation) 또는 [서비스 계정](https://cloud.google.com/iam/docs/service-account-overview)Panther는 사용을 지원합니다 [리전 엔드포인트](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#list_regional_endpoints)는 조직에 규정 준수 요구 사항(예: 데이터가 Google Cloud의 특정 리전에 유지되어야 함)이 있고 [`enforceInTransit` 플래그를 활성화해야 할 때 유용할 수 있습니다](https://docs.cloud.google.com/pubsub/docs/resource-location-restriction).

## Panther에서 Cloud Pub/Sub 로그 소스를 설정하는 방법

### 1단계: Panther에서 Pub/Sub 소스 구성

1. Panther Console의 왼쪽 탐색 모음에서 **로그 소스**.
2. 오른쪽 상단에서 다음을 클릭하세요: **새로 만들기**.
3. 다음 타일을 클릭하세요: **Google Cloud Pub/Sub** 타일.
4. 다음 페이지에서 **기본 정보** 페이지에서 다음 필드를 입력하세요:
   * **이름**: 로그 소스에 대한 설명적인 이름을 입력하세요.
   * **로그 유형**: Panther가 로그를 파싱하는 데 사용할 로그 유형을 선택하세요.
5. 클릭합니다 **설정.**
6. 다음 페이지에서 **로그 형식** 페이지에서 [스트림 유형](/ko/data-onboarding/custom-log-types/reference.md#stream-type) 들어오는 로그의:
   * **자동**
   * **줄**
   * **JSON**
   * **JSON 배열**
   * **XML**
7. 클릭합니다 **계속**.
8. 다음 페이지에서 **구성** 페이지에서 필요한 인프라 구성 요소를 만들기 위한 단계를 따르세요.
   * 아래 지침은 Terraform 템플릿 사용을 기반으로 합니다. Terraform을 사용하고 싶지 않다면, 대체 문서를 따라 [인프라 구성 요소 프로세스를 수동으로 완료할 수 있습니다](#manual-creation-in-gcp-console).

### 2단계: GCP 클라우드에서 필요한 인프라 생성

GCP 인프라를 생성하기 전에 다음을 결정해야 합니다:

* 인증 방법: 다음을 사용할 수 있습니다 [AWS를 사용하는 Google Cloud Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation) 또는 [서비스 계정](https://cloud.google.com/iam/docs/service-account-overview)—아래의 상위 탭을 참조하세요.
* 생성 방법: Terraform을 사용하여 인프라를 만들거나, GCP 콘솔에서 수동으로 만들 수 있습니다—아래의 각 상위 탭 내 하위 탭을 참조하세요.

{% hint style="warning" %}
구독을 만들 때는 `enable_exactly_once_delivery`를 활성화하지 마세요. Panther는 Pub/Sub 소스에 대한 정확히 한 번 전달을 지원하지 않으며, 이로 인해 처리량이 크게 낮아지고 지연 시간이 더 길어질 수 있습니다.
{% endhint %}

{% tabs %}
{% tab title="서비스 계정 인증" %}
Panther가 다음을 사용하여 인증하도록 하려면 [Google Cloud 서비스 계정](https://cloud.google.com/iam/docs/service-account-overview)을 사용해 아래 탭 중 하나의 지침을 따르세요.

{% tabs %}
{% tab title="Terraform" %}
Terraform을 사용하여 GCP 인프라를 생성하려면(서비스 계정으로 인증):

1. 다음 페이지에서 **인프라 및 자격 증명** 페이지에서 **서비스 계정** 탭.\
   ![Under an "Infrastructure & Credentials" header, a tab labeled "Service Account" is circled.](/files/b175839ecda1876760769681ff2388c54fa57e3a)
2. 클릭합니다 **Terraform 템플릿** 를 클릭하여 Terraform 템플릿을 다운로드합니다.
   * Terraform 템플릿은 다음에서도 찾을 수 있습니다: [이 GitHub 링크](https://github.com/panther-labs/panther-auxiliary/tree/main/terraform/panther_cloud_pubsub_transport_type_infra).
3. 다음의 필드를 채웁니다. `panther.tfvars` 파일에 구성 내용을 입력합니다.
   * 다음을 설정합니다 `authentication_method` 에서 `"service_account"`.
4. Terraform 구성 파일이 포함된 작업 디렉터리를 초기화하고 다음을 실행합니다 `terraform init`.
5. 해당하는 **Terraform 명령어를 복사하고** 제공된 명령을 CLI에서 실행합니다.
6. 다음을 복사하여 JSON 키 파일을 생성합니다. **gcloud 명령어** 를 제공된 대로 사용하되, 서비스 계정 이메일 주소의 값을 바꿔 CLI에서 실행합니다.
   * 서비스 계정 이메일은 다음의 출력에서 찾을 수 있습니다. **Terraform 명령어를 복사하고**.
     {% endtab %}

{% tab title="GCP 콘솔에서 수동 생성" %}
GCP 콘솔에서 GCP 인프라 구성 요소를 수동으로 생성하려면(서비스 계정으로 인증):

1. [주제 만들기](https://cloud.google.com/pubsub/docs/admin#creating_a_topic) 데이터에 대해.
   * 다음을 사용하여 주제를 만들 수 있습니다. `gcloud` CLI 도구와 다음 명령 형식을 사용합니다: `gcloud pubsub topics create $TOPIC_ID`
2. [구독 만들기](https://cloud.google.com/pubsub/docs/admin#pubsub_create_pull_subscription-gcloud) 방금 만든 주제와 함께 사용할 것입니다.
   * 다음을 사용하여 구독을 만들 수 있습니다. `gcloud` CLI 도구와 다음 명령 형식을 사용합니다: `gcloud pubsub subscriptions create $SUBSCRIPTION_ID --topic $TOPIC_ID --topic-project $PROJECT_ID`

{% hint style="warning" %}
이 구독은 다른 서비스나 소스에서 사용하면 안 됩니다.
{% endhint %}

3. [IAM API 사용 설정](https://console.cloud.google.com/apis/library/iam.googleapis.com).
4. [새 Google Cloud 서비스 계정 만들기](https://cloud.google.com/iam/docs/creating-managing-service-accounts). 다음을 사용해 계정을 만들려면 `gcloud` CLI 도구에서 다음 명령 형식을 사용합니다:

   ```
   gcloud iam service-accounts create SA-NAME \\
       --description="DESCRIPTION" \\
       --display-name="DISPLAY_NAME"
   ```

   * Panther가 이 GCS 통합을 위해 생성된 인프라에 액세스할 때 이 계정 이메일 주소를 사용하므로 반드시 기록해 두세요.
5. 계정에 필요한 IAM 역할을 할당합니다.
   * 다음 권한은 Pub/Sub 구독 및 주제가 있는 프로젝트에 필요합니다.

     <table data-header-hidden><thead><tr><th width="327.374982940047" align="center">필수 권한</th><th width="294.15662026309724" align="center">역할</th><th width="208" align="center">조건</th></tr></thead><tbody><tr><td align="center"><strong>필요한 권한</strong></td><td align="center"><strong>역할</strong></td><td align="center"><strong>범위</strong></td></tr><tr><td align="center"><code>pubsub.subscriptions.consume</code></td><td align="center"><code>roles/pubsub.subscriber</code></td><td align="center"><em>subscription-name</em></td></tr><tr><td align="center"><code>pubsub.subscriptions.get</code></td><td align="center"><code>roles/pubsub.viewer</code></td><td align="center"><em>subscription-name</em></td></tr><tr><td align="center"><code>monitoring.timeSeries.list</code></td><td align="center"><code>roles/monitoring.viewer</code></td><td align="center">project</td></tr></tbody></table>

     * 다음 `monitoring.timeSeries.list` 권한은 선택 사항이지만, 향상된 자동 확장을 위해 권장됩니다.
     * **참고:** 특정 리소스의 권한에 조건이나 IAM 정책을 설정할 수 있습니다. 이는 서비스 계정의 IAM 페이지(아래 예시 스크린샷 참조) 또는 특정 리소스의 페이지에서 할 수 있습니다.\
       ![On the IAM page of the service account, under the header "Grant this service account access to project," there are fields for Rule and Condition.](/files/1b523633a754a29391ad136335714390650eda65)
     * **참고:** 다음을 사용하여 권한을 만들 수 있습니다. `gcloud` CLI 도구:
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:$SERVICE_ACCOUNT_EMAIL" --role="roles/pubsub.subscriber"`
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:$SERVICE_ACCOUNT_EMAIL" --role="roles/pubsub.viewer"`
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:$SERVICE_ACCOUNT_EMAIL" --role="roles/monitoring.viewer"`
6. [JSON 키 파일 생성](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) 서비스 계정용이며, Panther에서 GCP 인프라에 인증할 때 사용됩니다.
   * gcloud CLI 도구를 사용하여 JSON 키 파일을 만들려면 다음 명령 형식을 실행합니다:\
     `gcloud iam service-accounts keys create $KEYFILE_PATH --iam-account=$SERVICE_ACCOUNT_EMAIL`
   * 또는 위 명령을 로컬 대신 GCP의 터미널에서 실행할 수도 있습니다.
     1. 오른쪽 상단의 점 3개 아이콘 메뉴를 클릭한 다음 **다운로드**.
        * ![](/files/3795f2e6340c4cbf7221fc15a478e410d67cc099)
     2. 찾아보기용 폴더 아이콘을 클릭합니다.
     3. 키 파일로 이동하여 선택한 다음 **다운로드**.
        {% endtab %}
        {% endtabs %}
        {% endtab %}

{% tab title="Workload Identity Federation 인증" %}
Panther가 다음을 사용하여 인증하도록 하려면 [Google Cloud Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation)을 사용해 아래 탭 중 하나의 지침을 따르세요.

{% tabs %}
{% tab title="Terraform" %}
Terraform을 사용하여 GCP 인프라 구성 요소를 생성하려면(Workload Identity Federation으로 인증):

1. 다음 페이지에서 **인프라 및 자격 증명 페이지**, 다음을 클릭합니다 **Workload Identity Federation** 탭.\
   ![Under an "Infrastructure & Credentials" header, a tab labeled "Workload Identity Federation" is circled.](/files/0c4d70ff9cc1d6aa3da7cf3c6a2ad07e36628746)
2. 클릭합니다 **Terraform 템플릿** 를 클릭하여 Terraform 템플릿을 다운로드합니다.
   * Terraform 템플릿은 다음에서도 찾을 수 있습니다: [이 GitHub 링크](https://github.com/panther-labs/panther-auxiliary/tree/main/terraform/panther_cloud_pubsub_transport_type_infra).
3. 다음의 필드를 채웁니다. `panther.tfvars` 파일에 구성 내용을 입력합니다.
   * 다음을 설정합니다 `authentication_method` 에서 `"workload_identity_federation"`.
   * 다음에 대한 값을 제공하세요. `panther_workload_identity_pool_id`, `panther_workload_identity_pool_provider_id`**,** 및 `panther_aws_account_id`.
4. Terraform 구성 파일이 포함된 작업 디렉터리를 초기화하고 다음을 실행합니다 `terraform init`.
5. 해당하는 **Terraform 명령어를 복사하고** 제공된 명령을 CLI에서 실행합니다.
6. 다음을 복사하여 풀용 자격 증명 구성 파일을 생성합니다. **gcloud 명령어** 를 제공된 대로 사용하되, 프로젝트 번호, 풀 ID, 공급자 ID의 값을 바꿔 CLI에서 실행합니다.
   * 프로젝트 번호, 풀 ID, 공급자 ID는 다음의 출력에서 찾을 수 있습니다. **Terraform 명령어를 복사하고**.
     {% endtab %}

{% tab title="GCP 콘솔에서 수동 생성" %}
GCP 콘솔에서 GCP 인프라 구성 요소를 수동으로 생성하려면(Workload Identity Federation으로 인증):

1. [주제 만들기](https://cloud.google.com/pubsub/docs/admin#creating_a_topic) 데이터에 대해.
   * 다음을 사용하여 주제를 만들 수 있습니다. `gcloud` CLI 도구와 다음 명령 형식을 사용합니다: `gcloud pubsub topics create $TOPIC_ID`
2. [구독 만들기](https://cloud.google.com/pubsub/docs/admin#pubsub_create_pull_subscription-gcloud) 방금 만든 주제와 함께 사용할 것입니다.
   * 다음을 사용하여 구독을 만들 수 있습니다. `gcloud` CLI 도구와 다음 명령 형식을 사용합니다: `gcloud pubsub subscriptions create $SUBSCRIPTION_ID --topic $TOPIC_ID --topic-project $PROJECT_ID`

{% hint style="warning" %}
이 구독은 다른 서비스나 소스에서 사용하면 안 됩니다.
{% endhint %}

3. [IAM API 사용 설정](https://console.cloud.google.com/apis/library/iam.googleapis.com).
4. 다음을 따라 AWS와 함께 Workload Identity Federation을 구성합니다. [AWS 또는 Azure와 함께 Workload Identity Federation 구성](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds) 문서.
   1. 다음을 [속성 매핑 및 조건을 정의하는 동안](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#mappings-and-conditions), 다음 예제를 참고하세요:
      * 예시 [속성 매핑](https://cloud.google.com/iam/docs/workload-identity-federation#mapping):

        <table><thead><tr><th width="195.8271484375">Google</th><th width="523.1220703125">AWS</th></tr></thead><tbody><tr><td><code>google.subject</code></td><td><code>assertion.arn.extract('arn:aws:sts::{account_id}:')+":"+assertion.arn.extract('assumed-role/{role_and_session}').extract('/{session}')</code></td></tr><tr><td><code>attribute.account</code></td><td><code>assertion.account</code></td></tr></tbody></table>
      * 예시 [속성 조건](https://cloud.google.com/iam/docs/workload-identity-federation#conditions):\
        `attribute.account=="<PANTHER_AWS_ACCOUNT_ID>"`

{% hint style="warning" %}
다음의 값은 `google.subject` 속성 [127자를 초과할 수 없습니다](https://cloud.google.com/iam/docs/workload-identity-federation#mapping). 다음을 사용할 수 있습니다 [Common Expression Language(CEL) 표현식](https://cloud.google.com/iam/docs/workload-identity-federation#mapping) 을 사용하여 AWS에서 발급한 토큰의 속성을 변환하거나 결합할 수 있습니다. 위 표에서 제안한 표현식은 이 제한을 고려한 것이며, ARN을 Panther 엔터티를 고유하게 식별하는 값으로 변환하려는 시도입니다. AWS 속성에 대한 자세한 내용은 [이 AWS 문서 페이지의 "Example 2 - Called by user created with AssumeRole"를 참조하세요.](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html).
{% endhint %}

5. 당신이 [신원 풀에 공급자를 추가할 때](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#aws), 선택 **AWS**.
6. 계정에 필요한 IAM 역할을 할당합니다.
   * 다음 권한은 Pub/Sub 구독 및 주제가 있는 프로젝트에 필요합니다.

     <table data-header-hidden><thead><tr><th width="327.374982940047" align="center">필수 권한</th><th width="294.15662026309724" align="center">역할</th><th width="208" align="center">조건</th></tr></thead><tbody><tr><td align="center"><strong>필요한 권한</strong></td><td align="center"><strong>역할</strong></td><td align="center"><strong>범위</strong></td></tr><tr><td align="center"><code>pubsub.subscriptions.consume</code></td><td align="center"><code>roles/pubsub.subscriber</code></td><td align="center"><em>subscription-name</em></td></tr><tr><td align="center"><code>pubsub.subscriptions.get</code></td><td align="center"><code>roles/pubsub.viewer</code></td><td align="center"><em>subscription-name</em></td></tr><tr><td align="center"><code>monitoring.timeSeries.list</code></td><td align="center"><code>roles/monitoring.viewer</code></td><td align="center">project</td></tr></tbody></table>

     * 다음 `monitoring.timeSeries.list` 권한은 선택 사항이지만, 향상된 자동 확장을 위해 권장됩니다.
     * **참고:** 특정 리소스의 권한에 조건이나 IAM 정책을 설정할 수 있습니다. 이는 GCP의 IAM 섹션(아래 예시 스크린샷 참조) 또는 특정 리소스의 페이지에서 할 수 있습니다.\
       ![In the Google Cloud console, the "IAM" navigation bar item is circled. In a slide-out panel, sections titled "Add principals" and "Assign roles" are circled.](/files/a4a66c9ddb93df2d2e451f85e9839e240f453bd6)
     * **참고:** 다음을 사용하여 권한을 만들 수 있습니다. `gcloud` CLI 도구에서 `$PRINCIPAL_ID` 는 다음과 같을 수 있습니다:\
       `principalSet://iam.googleapis.com/projects/<THE_ACTUAL_GOOGLE_PROJECT_NUMBER>/locations/global/workloadIdentityPools/<THE_ACTUAL_POOL_ID>/attribute.account/<THE_ACTUAL_PANTHER_AWS_ACCOUNT_ID>`
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="$PRINCIPAL_ID" --role="roles/pubsub.subscriber"`
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="$PRINCIPAL_ID" --role="roles/pubsub.viewer"`
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="$PRINCIPAL_ID" --role="roles/monitoring.viewer"`
7. [자격 증명 구성 파일 다운로드](https://cloud.google.com/iam/docs/workload-download-cred-and-grant-access)는 Panther에서 GCP 인프라에 인증할 때 사용됩니다.
   * gcloud CLI 도구를 사용하여 자격 증명 구성 파일을 생성하려면 다음 명령 형식을 사용합니다:\
     `gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/global/workloadIdentityPools/$POOL_ID/providers/$PROVIDER_ID --aws --output-file=config.json`
     {% endtab %}
     {% endtabs %}
     {% endtab %}
     {% endtabs %}

### 3단계: Panther에서 소스 설정 완료

{% tabs %}
{% tab title="서비스 계정 인증" %}
다음을 사용하는 경우 [Google Cloud 서비스 계정](https://cloud.google.com/iam/docs/service-account-overview) 로 인증하려면:

1. 아래 **풀링 구성 및 JSON 키 파일 제공**를 업로드합니다.
2. 다음을 입력합니다. **Pub/Sub 구독 ID,** 다음에서 찾을 수 있습니다. **구독** Google Cloud 계정의 섹션.\
   ![](/files/2adeb93a382c4d87037a1a79f2ca2d7f8eebe8fe)
3. 아래 **리전 엔드포인트(선택 사항)**, 선택적으로 [리전 엔드포인트](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#list_regional_endpoints).
4. 클릭합니다 **설정**. 성공 화면으로 이동합니다:

   <figure><img src="/files/e0820e5acb9452e294cfe3ba72060f0fbbfd3b32" alt="The success screen reads, &#x22;Everything looks good! Panther will now automatically pull &#x26; process logs from your account&#x22;" width="281"><figcaption></figcaption></figure>

   * 선택적으로 하나 이상의 [디택션 팩](https://docs.panther.com/detections/panther-managed/packs).
   * 아직 하지 않았다면 다음을 클릭하세요: **스키마 연결 또는 추론** 소스에 하나 이상의 스키마를 연결합니다.
   * 다음 **이벤트가 처리되지 않으면 알러트를 발생시키기** 설정의 기본값은 **예**. 일정 시간 후 로그 소스에서 데이터 흐름이 중단되면 알러트를 받게 되므로 이 설정을 켠 상태로 두는 것을 권장합니다. 시간 범위는 구성 가능하며 기본값은 24시간입니다.

     <figure><img src="/files/7db146cd7acee3d0704a4a8b2157f230cfa22168" alt="The &#x22;Trigger an alert when no events are processed&#x22; toggle is set to YES. The &#x22;How long should Panther wait before it sends you an alert that no events have been processed&#x22; setting is set to 1 Day" width="320"><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Workload Identity Federation 인증" %}
다음을 사용하는 경우 [Google Cloud Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation) 로 인증하려면:

1. 다음 페이지에서 **인프라 및 자격 증명 페이지**아직 하지 않았다면 **Workload Identity Federation** 탭.\
   ![Under an "Infrastructure & Credentials" header, a tab labeled "Workload Identity Federation" is circled.](/files/0c4d70ff9cc1d6aa3da7cf3c6a2ad07e36628746)
2. 아래 **풀링 구성 및 자격 증명 구성 파일 제공**를 업로드합니다.
3. 다음을 입력합니다. **Pub/Sub 구독 ID** 및 **프로젝트 ID**, 다음에서 찾을 수 있습니다 **구독** Google Cloud 계정의 섹션.\
   ![In a tab titled "Workload Identity Federation," there are various buttons and form fields, including "GCS Bucket Name," "Pub/Sub Subscription ID," and "Project ID."](/files/41821ca2d18de354bd741dd96c6af512c8f8b510)
4. 아래 **리전 엔드포인트(선택 사항)**, 선택적으로 [리전 엔드포인트](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#list_regional_endpoints).
5. 클릭합니다 **설정**. 성공 화면으로 이동합니다:

   <figure><img src="/files/e0820e5acb9452e294cfe3ba72060f0fbbfd3b32" alt="The success screen reads, &#x22;Everything looks good! Panther will now automatically pull &#x26; process logs from your account&#x22;" width="281"><figcaption></figcaption></figure>

   * 선택적으로 하나 이상의 [디택션 팩](https://docs.panther.com/detections/panther-managed/packs).
   * 아직 하지 않았다면 다음을 클릭하세요: **스키마 연결 또는 추론** 소스에 하나 이상의 스키마를 연결합니다.
   * 다음 **이벤트가 처리되지 않으면 알러트를 발생시키기** 설정의 기본값은 **예**. 일정 시간 후 로그 소스에서 데이터 흐름이 중단되면 알러트를 받게 되므로 이 설정을 켠 상태로 두는 것을 권장합니다. 시간 범위는 구성 가능하며 기본값은 24시간입니다.

     <figure><img src="/files/7db146cd7acee3d0704a4a8b2157f230cfa22168" alt="The &#x22;Trigger an alert when no events are processed&#x22; toggle is set to YES. The &#x22;How long should Panther wait before it sends you an alert that no events have been processed&#x22; setting is set to 1 Day" width="320"><figcaption></figcaption></figure>

{% endtab %}
{% endtabs %}

## 수집된 로그 보기

로그 소스가 구성된 후 다음을 사용하여 수집된 데이터를 검색할 수 있습니다: [검색](/ko/search/search-tool.md) 또는 [데이터 탐색기](/ko/search/data-explorer.md).


---

# 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/data-onboarding/data-transports/google/pubsub.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.
