Anthropic
Synopsis
Enriches events by sending field content to Anthropic's Claude API to analyze the content and store the response.
Schema
anthropic:
- field: <ident>
- api_key: <string>
- target_field: <ident>
- developer_msg: <string>
- description: <text>
- if: <script>
- ignore_failure: <boolean>
- ignore_missing: <boolean>
- model: <string>
- temperature: <number>
- max_tokens: <number>
- on_failure: <processor[]>
- on_success: <processor[]>
- tag: <string>
Configuration
Field | Required | Default | Description |
---|---|---|---|
field | Y | message | Field containing content to analyze |
api_key | Y | - | Anthropic API key for authentication |
target_field | N | field | Field to store the API response |
developer_msg | N | System message for context | Default system message for one-word responses unless explanation requested |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue if API call fails |
ignore_missing | N | false | Continue if source field doesn't exist |
model | N | claude-3-opus-20240229 | Claude model to use |
temperature | N | 0.7 | Response randomness (0-1) |
max_tokens | N | 1000 | Maximum response length |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
The processor is useful for automated analysis, context enrichment, and intelligent processing of log data. It supports system context messages for analysis, temperature control for response variation, and token limits for response length management.
The latest Claude models are available. Supported models: claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307.
Invalid model names will cause processing errors.
API responses are cached to improve performance.
API calls add latency to event processing.
Developer messages help guide Claude's analysis, and lower temperature values produce more focused responses. Also, consider rate limits and costs for high-volume processing. Token limits control response length and costs, and long input texts may hit token limits.
API keys must be securely stored and accessed.
Examples
Basic
Analyzing a Cisco device log... |
|
adds information to the event: |
|
Precision
Configuring analysis parameters... |
|
produces more focused security insights: |
|
Conditionals
Analyzing only critical errors... |
|
is preferable due to level: |
|
Error Handling
Handling API failures gracefully... |
|
continues execution: |
|