# splunk/pytest-splunk-addon architecture

> Architecture diagram of the GitHub repository splunk/pytest-splunk-addon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/splunk/pytest-splunk-addon
- Repository: https://github.com/splunk/pytest-splunk-addon

## Overview

pytest-splunk-addon is a dynamic testing tool for Splunk apps and add-ons. Its user-facing workflow is to configure a Splunk app, derive test inputs and sample events, run checks against a Splunk instance, and optionally produce CIM compliance output. The graph includes app parsing, sample generation and ingestion, CIM and field validation, and Splunk integration. Some subsystem paths are supported by the tree and SOURCE INDEX, but their internal calls were not sampled; those relationships are left out or marked unverified.

Main entry points: [`pytest_splunk_addon/event_ingestors/base_event_ingestor.py`](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/base_event_ingestor.py) (Ingestor interface), [`pytest_splunk_addon/addon_parser/__init__.py`](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/__init__.py) (Addon config parser), [`pytest_splunk_addon/splunk.py`](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/splunk.py) (Splunk fixtures), [`pytest_splunk_addon/addon_parser/transforms_parser.py`](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/transforms_parser.py) (Transforms parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_parsing["App Parsing"]
  node_app_parser["Addon config parser<br/>[__init__.py]"]
  node_props["Props parser<br/>[props_parser.py]"]
  node_transforms["Transforms parser"]
  node_fields["Field definitions<br/>[fields.py]"]
  node_parser_cache[("Parser cache<br/>[parser_cache.py]")]
end

subgraph group_generation["Samples and Ingestion"]
  node_sample_config["Sample config parser"]
  node_sample_stanza["Sample stanza<br/>[sample_stanza.py]"]
  node_sample_rules["Sample rules<br/>[rule.py]"]
  node_sample_event["Sample event<br/>[sample_event.py]"]
  node_sample_generator["Sample generator"]
  node_ingestor_helper["Ingestion dispatcher<br/>[ingestor_helper.py]"]
  node_event_ingestor["Ingestor interface"]
  node_hec_event["HEC event ingestion"]
  node_hec_raw["HEC raw ingestion"]
  node_file_ingest["File monitoring ingestion"]
end

subgraph group_validation["Addon Validation"]
  node_cim_models["CIM data models"]
  node_field_tests["CIM field checks"]
  node_compliance["Compliance reports"]
  node_markdown["Markdown output<br/>[markdown_report.py]"]
end

subgraph group_runtime["Splunk Runtime"]
  node_splunk_plugin["Splunk fixtures<br/>[splunk.py]"]
  node_splunk(("Splunk service"))
end

node_user(("Addon developer"))

node_user -.->|"configures tests"| node_splunk_plugin
node_app_parser -->|"parses config"| node_props
node_app_parser -->|"parses config"| node_transforms
node_app_parser -->|"loads fields"| node_fields
node_props -->|"reads transforms"| node_transforms
node_transforms -->|"caches parsing"| node_parser_cache
node_sample_config -->|"creates stanzas"| node_sample_stanza
node_sample_config -->|"uses rules"| node_sample_rules
node_sample_generator -.->|"creates events"| node_sample_event
node_splunk_plugin -->|"dispatches ingestion"| node_ingestor_helper
node_ingestor_helper -->|"selects ingestor"| node_event_ingestor
node_event_ingestor -.->|"implemented by"| node_hec_event
node_event_ingestor -.->|"implemented by"| node_hec_raw
node_event_ingestor -.->|"implemented by"| node_file_ingest
node_hec_event -->|"sends events"| node_splunk
node_hec_raw -->|"sends raw data"| node_splunk
node_file_ingest -->|"configures forwarder"| node_splunk
node_cim_models -->|"maps event tags"| node_app_parser
node_compliance -->|"renders report"| node_markdown
node_splunk_plugin -->|"connects to"| node_splunk

click node_app_parser "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/__init__.py"
click node_props "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/props_parser.py"
click node_transforms "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/transforms_parser.py"
click node_fields "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/fields.py"
click node_parser_cache "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/parser_cache.py"
click node_sample_config "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py"
click node_sample_stanza "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/sample_stanza.py"
click node_sample_rules "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/rule.py"
click node_sample_event "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/sample_event.py"
click node_sample_generator "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/sample_generator.py"
click node_ingestor_helper "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/ingestor_helper.py"
click node_event_ingestor "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/base_event_ingestor.py"
click node_hec_event "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/hec_event_ingestor.py"
click node_hec_raw "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py"
click node_file_ingest "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py"
click node_splunk_plugin "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/splunk.py"
click node_cim_models "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_tests/data_model_handler.py"
click node_field_tests "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_tests/field_test_helper.py"
click node_compliance "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_compliance/cim_report_generator.py"
click node_markdown "https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_compliance/markdown_report.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_parser,node_props,node_transforms,node_fields,node_parser_cache toneBlue
class node_sample_config,node_sample_stanza,node_sample_rules,node_sample_event,node_sample_generator,node_ingestor_helper,node_event_ingestor,node_hec_event,node_hec_raw,node_file_ingest toneAmber
class node_cim_models,node_field_tests,node_compliance,node_markdown toneMint
class node_splunk_plugin,node_splunk toneRose
class node_user toneIndigo
```

## Components

### App Parsing

- [Addon config parser](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/__init__.py): `pytest_splunk_addon/addon_parser/__init__.py`
- [Props parser](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/props_parser.py): `pytest_splunk_addon/addon_parser/props_parser.py`
- [Transforms parser](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/transforms_parser.py): `pytest_splunk_addon/addon_parser/transforms_parser.py`
- [Field definitions](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/fields.py): `pytest_splunk_addon/addon_parser/fields.py`
- [Parser cache](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/addon_parser/parser_cache.py): `pytest_splunk_addon/addon_parser/parser_cache.py`

### Samples and Ingestion

- [Sample config parser](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py): `pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py`
- [Sample stanza](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/sample_stanza.py): `pytest_splunk_addon/sample_generation/sample_stanza.py`
- [Sample rules](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/rule.py): `pytest_splunk_addon/sample_generation/rule.py`
- [Sample event](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/sample_event.py): `pytest_splunk_addon/sample_generation/sample_event.py`
- [Sample generator](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/sample_generation/sample_generator.py): `pytest_splunk_addon/sample_generation/sample_generator.py`
- [Ingestion dispatcher](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/ingestor_helper.py): `pytest_splunk_addon/event_ingestors/ingestor_helper.py`
- [Ingestor interface](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/base_event_ingestor.py): `pytest_splunk_addon/event_ingestors/base_event_ingestor.py`
- [HEC event ingestion](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/hec_event_ingestor.py): `pytest_splunk_addon/event_ingestors/hec_event_ingestor.py`
- [HEC raw ingestion](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py): `pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py`
- [File monitoring ingestion](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py): `pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py`

### Addon Validation

- [CIM data models](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_tests/data_model_handler.py): `pytest_splunk_addon/cim_tests/data_model_handler.py`
- [CIM field checks](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_tests/field_test_helper.py): `pytest_splunk_addon/cim_tests/field_test_helper.py`
- [Compliance reports](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_compliance/cim_report_generator.py): `pytest_splunk_addon/cim_compliance/cim_report_generator.py`
- [Markdown output](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/cim_compliance/markdown_report.py): `pytest_splunk_addon/cim_compliance/markdown_report.py`

### Splunk Runtime

- [Splunk fixtures](https://github.com/splunk/pytest-splunk-addon/blob/main/pytest_splunk_addon/splunk.py): `pytest_splunk_addon/splunk.py`
- **Splunk service**

### Other components

- **Addon developer**

## Connections

- Addon developer → Splunk fixtures: configures tests
- Addon config parser → Props parser: parses config (evidence: `pytest_splunk_addon/addon_parser/__init__.py`)
- Addon config parser → Transforms parser: parses config (evidence: `pytest_splunk_addon/addon_parser/__init__.py`)
- Addon config parser → Field definitions: loads fields (evidence: `pytest_splunk_addon/addon_parser/__init__.py`)
- Props parser → Transforms parser: reads transforms (evidence: `pytest_splunk_addon/addon_parser/props_parser.py`)
- Transforms parser → Parser cache: caches parsing (evidence: `pytest_splunk_addon/addon_parser/transforms_parser.py`)
- Sample config parser → Sample stanza: creates stanzas (evidence: `pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py`)
- Sample config parser → Sample rules: uses rules (evidence: `pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py`)
- Sample generator → Sample event: creates events (evidence: `pytest_splunk_addon/sample_generation/__init__.py`)
- Splunk fixtures → Ingestion dispatcher: dispatches ingestion (evidence: `pytest_splunk_addon/splunk.py`)
- Ingestion dispatcher → Ingestor interface: selects ingestor (evidence: `pytest_splunk_addon/event_ingestors/ingestor_helper.py`)
- Ingestor interface → HEC event ingestion: implemented by (evidence: `pytest_splunk_addon/event_ingestors/hec_event_ingestor.py`)
- Ingestor interface → HEC raw ingestion: implemented by (evidence: `pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py`)
- Ingestor interface → File monitoring ingestion: implemented by (evidence: `pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py`)
- HEC event ingestion → Splunk service: sends events (evidence: `pytest_splunk_addon/event_ingestors/hec_event_ingestor.py`)
- HEC raw ingestion → Splunk service: sends raw data (evidence: `pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py`)
- File monitoring ingestion → Splunk service: configures forwarder (evidence: `pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py`)
- CIM data models → Addon config parser: maps event tags (evidence: `pytest_splunk_addon/cim_tests/data_model_handler.py`)
- Compliance reports → Markdown output: renders report (evidence: `pytest_splunk_addon/cim_compliance/cim_report_generator.py`)
- Splunk fixtures → Splunk service: connects to (evidence: `pytest_splunk_addon/splunk.py`)
