Azure Log Analytics
로그와 메트릭을 Azure Log Analytics로 보내는 출력 플러그인이에요. Azure 모니터링과 연동하고 싶을 때 유용하죠.
출처: 문서
본문
로그와 메트릭을 Azure Log Analytics에 보냅니다.
Azure 출력 플러그인은 레코드를 Azure Log Analytics 서비스에 수집하게 해줍니다.
Azure Log Analytics 설정 방법에 대한 자세한 내용은 Azure Log Analytics 문서를 참고하세요.
설정 파라미터 (Configuration parameters)
| Key | Description | Default |
|---|---|---|
customer_id |
Customer ID 또는 WorkspaceID 문자열입니다. | 없음 |
log_type |
이벤트 유형의 이름입니다. | fluentbit |
log_type_key |
포함되면 이 키의 값이 레코드에서 확인되고, 있으면 log_type을 덮어씁니다. 없으면 log_type 값이 사용됩니다. |
없음 |
shared_key |
기본 또는 보조 Connected Sources 클라이언트 인증 키입니다. | 없음 |
time_generated |
활성화하면 HTTP 요청 헤더 time-generated-field가 포함되어 Azure가 time_key 옵션으로 지정된 키로 타임스탬프를 재정의할 수 있습니다. |
false |
time_key |
선택 사항. 타임스탬프가 저장될 키 이름을 지정합니다. | @timestamp |
workers |
이 출력에 대한 플러시 작업을 수행할 워커 수입니다. | 0 |
시작하기 (Get started)
Azure Log Analytics 인스턴스에 레코드를 삽입하려면 명령줄에서 또는 설정 파일을 통해 플러그인을 실행할 수 있습니다.
명령줄 (Command line)
Azure 플러그인은 -p 인자(속성)를 사용해 명령줄에서 파라미터를 다음과 같이 읽을 수 있습니다:
fluent-bit -i cpu -o azure -p customer_id=abc -p shared_key=def -m '*' -f 1
설정 파일 (Configuration file)
메인 설정 파일에 다음 섹션들을 추가하세요:
{% tabs %} {% tab title="fluent-bit.yaml" %}
pipeline:
inputs:
- name: cpu
outputs:
- name: azure
match: '*'
customer_id: abc
shared_key: def
{% endtab %}
{% tab title="fluent-bit.conf" %}
[INPUT]
Name cpu
[OUTPUT]
Name azure
Match *
Customer_ID abc
Shared_Key def
{% endtab %} {% endtabs %}
다음 예시는 record-accessor와 함께 Log_Type_Key를 사용하는데, Log_Type 대신 Kubernetes 라벨 app에서 테이블 이름(또는 이벤트 유형)을 동적으로 읽습니다:
{% tabs %} {% tab title="fluent-bit.yaml" %}
pipeline:
inputs:
- name: cpu
outputs:
- name: azure
match: '*'
log_type_key: $kubernetes['labels']['app']
customer_id: abc
shared_key: def
{% endtab %}
{% tab title="fluent-bit.conf" %}
[INPUT]
Name cpu
[OUTPUT]
Name azure
Match *
Log_Type_Key $kubernetes['labels']['app']
Customer_ID abc
Shared_Key def
{% endtab %} {% endtabs %}