Splunk HTTP Event Collector(HEC) 소스
개요
Observability Pipelines의 Splunk HTTP Event Collector(HEC) 소스를 사용하여 Splunk HEC에서 로그를 수신하세요. HEC 토큰을 이벤트 메타데이터로 저장하고 다음을 수행하도록 선택할 수 있습니다.
- 이벤트와 함께 전송된 원래 토큰을 사용하여 Observability Pipelines에서 Splunk HEC로 로그를 전송합니다.
- Enrichment Table 프로세서를 사용하여 메타데이터의 토큰을 기반으로 조회 파일에서 로그 필드를 추가한 다음, 해당 필드의 값을 기반으로 로그를 처리하고 라우팅합니다.
참고:
- Worker는 수신한 저장된 HEC 토큰을 다음 구성 요소로 전달합니다.
- 저장된 Splunk HEC 토큰은 Live Capture에 표시되지 않습니다.
- Splunk Distribution of the OpenTelemetry Collector에서 Observability Pipelines로 로그를 전송하려면 Splunk HEC 소스를 사용하세요.
전제 조건
To use Observability Pipelines’ Splunk HTTP Event Collector (HEC) source, you have applications sending data to Splunk in the expected HEC format.
To use Observability Pipelines’ Splunk HEC destination, you have a Splunk Enterprise or Cloud instance configured with an HTTP Event Collector (HEC) input. You also have the following information available:
- The Splunk HEC token.
- The bind address that your Observability Pipelines Worker will listen on to receive logs from your applications. For example,
0.0.0.0:8080. Later on, you configure your applications to send logs to this address. - The base URL of the Splunk instance that the Worker will send processed logs to. This URL should include the port that is globally configured for Splunk HTTP Event Collectors on your Splunk instance. For example, for Splunk Cloud:
https://prd-p-0mupp.splunkcloud.com:8088. - If your HECs are globally configured to enable SSL, then you also need the appropriate TLS certificates and password you used to create your private key file.
See Configure HTTP Event Collector on Splunk Web for more information about setting up Splunk HEC.
Note: Observability Pipelines does not support HEC Indexer Acknowledgement.
설정
시크릿 관리: Splunk HEC 주소의 식별자와 해당하는 경우 TLS 키 암호 및 인증 토큰 키만 입력하세요. 실제 값은 입력하지 마세요.
파이프라인을 설정할 때 이 소스를 설정하세요. 파이프라인은 UI, API 또는 Terraform을 사용하여 설정할 수 있습니다. 이 섹션의 지침은 UI에서 소스를 설정하기 위한 것입니다.
파이프라인 UI에서 Splunk HEC 소스를 선택한 후:
- Splunk HEC 주소의 식별자를 입력하세요. 비워두면 기본값이 사용됩니다.
- 다음 중 하나를 수행하려는 경우에만 Store HEC token을 활성화하세요.
- From Source 토큰 전략과 함께 Splunk HEC 대상을 사용하세요.
- Enrichment Table 프로세서를 사용하여 로컬 파일에서 Splunk HEC 토큰을 매핑하세요.
If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with DD_OP_. For example, if you entered PASSWORD_1 for a password identifier, the environment variable for that password is DD_OP_PASSWORD_1.
선택적 설정
TLS 활성화
Toggle the switch to Enable TLS.
- If you are using Secrets Management, enter the identifier for the key pass. See Secret defaults for the default used if the field is left blank.
- Enter the following certificate and key files:
Server Certificate Path: The path to the certificate file that has been signed by your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509).- (Optional)
CA Certificate Path: The path to the certificate file that is your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509). - (Optional)
Private Key Path: The path to the .key private key file that belongs to your Server Certificate Path in DER, PEM, or CRT (PKCS #8) format. - Notes:
- The configuration data directory
/var/lib/observability-pipelines-worker/config/ is automatically appended to the file paths. See Advanced Worker Configurations for more information. - The file must be readable by the
observability-pipelines-worker group and user.
- (Optional) Toggle Verify certificate to require connecting clients to present a valid client certificate. This enforces mutual TLS (mTLS), where the Worker verifies the identity of each connecting client.
HTTP 요청의 인증 헤더에 Splunk HEC 토큰을 저장하는 경우, 들어오는 HTTP 요청에 유효한 토큰이 있는지 검사하도록 Observability Pipelines를 구성할 수 있습니다. 유효한 토큰이 없는 요청 이벤트는 삭제됩니다.
인증 토큰을 구성하려면 Configure authentication tokens 토글을 활성화하세요.
- Manage Tokens를 클릭한 다음 Add Token을 클릭하세요.
- 토큰 키의 식별자를 입력합니다.
참고: 환경 변수를 사용하는 경우 이 토큰에 대한 환경 변수는 입력한 식별자 앞에 DD_OP_를 붙인 값입니다. - (선택 사항) 이 특정 토큰으로 인증에 성공한 로그에 추가 정보를 더하려면 필드와 값을 입력합니다.
시크릿 기본값
These are the defaults used for secret identifiers and environment variables.
- Splunk HEC 주소 식별자:
- Observability Pipelines Worker가 원래 Splunk 인덱서로 전송될 로그를 수신하기 위해 수신 대기하는 바인딩 주소(예:
0.0.0.0:8088)를 참조합니다. - 기본 식별자는
SOURCE_SPLUNK_HEC_ADDRESS입니다.
- Splunk HEC TLS 암호 식별자(TLS가 활성화된 경우):
- 기본 식별자는
SOURCE_SPLUNK_HEC_KEY_PASS입니다.
- Splunk HEC address:
- The bind address that your Observability Pipelines Worker listens on to receive logs originally intended for the Splunk indexer. For example,
0.0.0.0:8088
Note: /services/collector/event is automatically appended to the endpoint. - The default environment variable is
DD_OP_SOURCE_SPLUNK_HEC_ADDRESS.
- Splunk HEC TLS passphrase (when enabled):
- The default environment variable is
DD_OP_SOURCE_SPLUNK_HEC_KEY_PASS.
Send logs to the Observability Pipelines Worker over Splunk HEC
After you install the Observability Pipelines Worker and deploy the configuration, the Worker exposes three HTTP endpoints that uses the Splunk HEC API:
/services/collector/event/services/collector/raw/services/collector/health
To send logs to your Splunk index, you must point your existing logs upstream to the Worker.
curl http://<OPW_HOST>:8088/services/collector/event \
-d '{"event": {"a": "value1", "b": ["value1_1", "value1_2"]}}'
<OPW_HOST> is the IP/URL of the host (or load balancer) associated with the Observability Pipelines Worker. For CloudFormation installs, the LoadBalancerDNS CloudFormation output has the correct URL to use. For Kubernetes installs, the internal DNS record of the Observability Pipelines Worker service can be used, for example opw-observability-pipelines-worker.default.svc.cluster.local.
At this point, your logs should be going to the Worker, processed by the pipeline, and delivered to the configured destination.
Splunk Distribution of the OpenTelemetry Collector에서 Observability Pipelines로 로그 전송
Splunk Distribution of the OpenTelemetry Collector에서 로그를 전송하려면:
- 환경에 따라 Splunk OpenTelemetry Collector를 설치하세요.
- 파이프라인 설정에 Splunk HEC 소스를 사용하세요.
- Splunk OpenTelemetry Collector를 구성하세요.
cp /etc/otel/collector/splunk-otel-collector.conf.example etc/otel/collector/splunk-otel-collector.conf
# Splunk HEC endpoint URL, if forwarding to Splunk Observability Cloud
# SPLUNK_HEC_URL=https://ingest.us0.signalfx.com/v1/log
# If you're forwarding to a Splunk Enterprise instance running on example.com, with HEC at port 8088:
SPLUNK_HEC_URL=http://<OPW_HOST>:8088/services/collector
<OPW_HOST>는 Observability Pipelines Worker와 연결된 호스트(또는 로드 밸런서)의 IP 또는 URL입니다.- CloudFormation 설치의 경우
LoadBalancerDNS CloudFormation 출력에 사용할 올바른 URL이 포함되어 있습니다. - Kubernetes 설치의 경우 Observability Pipelines Worker 서비스의 내부 DNS 레코드를 사용할 수 있습니다(예:
opw-observability-pipelines-worker.default.svc.cluster.local).
참고: 방화벽을 사용하는 경우 방화벽이 Splunk OpenTelemetry Collector에서 Worker로의 트래픽을 허용하는지 확인하세요.