# nmacroglou/search_profiling architecture

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

- Interactive diagram: https://gitdiagram.com/nmacroglou/search_profiling
- Repository: https://github.com/nmacroglou/search_profiling

## Overview

Search Profiling is a Splunk app for relating searches to the indexes and sourcetypes they touch, then presenting data-usage analytics. The main workflow runs summary searches and custom commands on active search heads, stores generated summaries in the search_profiling index, and makes usage views available to Splunk users. The repository also includes catalog-style UI pages and shared dashboard helpers. The README documents the analytics workflow; sampled source shows UI and command behavior, but not the summary-search definitions or their full wiring.

Main entry points: [`TA-search_profiling/default`](https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/TA-search_profiling/default) (Summary searches), [`SP-IndexCreation/default/indexes.conf`](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SP-IndexCreation/default/indexes.conf) (Summary index), [`SA-search_profiling/appserver/static/dashboard.js`](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/dashboard.js) (Dashboard behavior), [`SA-search_profiling/default/data/ui/views`](https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/SA-search_profiling/default/data/ui/views) (Usage dashboards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Search profiling"]
  node_searches[("Search activity")]
  node_summary["Summary searches"]
  node_lookups[("Profiling lookups")]
  node_summaryindex[("Summary index<br/>[indexes.conf]")]
end

subgraph group_processing["Search processing"]
  node_macro["Macro expansion<br/>[expandmacro.py]"]
  node_boolean["Boolean parsing<br/>[boolparse.py]"]
  node_matching["Multivalue matching<br/>[mvmatch.py]"]
end

subgraph group_analytics["Usage analytics"]
  node_analytics["Usage dashboards"]
end

subgraph group_interface["Splunk interface"]
  node_dashboardjs["Dashboard behavior<br/>[dashboard.js]"]
  node_contents["Content catalog<br/>[contents.js]"]
  node_datasources["Data source catalog"]
  node_usecases["Use case catalog"]
  node_kvstore["KVStore Backbone<br/>[kvstore.js]"]
  node_tokenlinks["Dashboard tokens<br/>[tokenlinks.js]"]
  node_rangemap["Table icons"]
end

node_operator(("Splunk owner"))
node_splunk{{"Splunk platform"}}

node_operator -->|"views usage"| node_analytics
node_searches -->|"summarized by"| node_summary
node_summary -->|"uses lookups"| node_lookups
node_summary -->|"writes summaries"| node_summaryindex
node_summary -.->|"expands macros"| node_macro
node_summary -.->|"parses conditions"| node_boolean
node_summary -.->|"matches fields"| node_matching
node_summaryindex -->|"drives analytics"| node_analytics
node_splunk -.->|"loads dashboard"| node_dashboardjs
node_splunk -.->|"loads catalog"| node_contents
node_splunk -.->|"loads catalog"| node_datasources
node_splunk -.->|"loads catalog"| node_usecases
node_dashboardjs -.-> node_kvstore

click node_summary "https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/TA-search_profiling/default"
click node_macro "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/TA-search_profiling/bin/expandmacro.py"
click node_boolean "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/TA-search_profiling/bin/boolparse.py"
click node_matching "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/TA-search_profiling/bin/mvmatch.py"
click node_lookups "https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/TA-search_profiling/default"
click node_summaryindex "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SP-IndexCreation/default/indexes.conf"
click node_analytics "https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/SA-search_profiling/default/data/ui/views"
click node_dashboardjs "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/dashboard.js"
click node_contents "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/contents.js"
click node_datasources "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/datasource_contents.js"
click node_usecases "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/usecase_contents.js"
click node_kvstore "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/components/kvstore_backbone/kvstore.js"
click node_tokenlinks "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/tokenlinks.js"
click node_rangemap "https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/table_icons_rangemap.js"

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_searches,node_summary,node_lookups,node_summaryindex toneBlue
class node_macro,node_boolean,node_matching toneAmber
class node_analytics toneMint
class node_dashboardjs,node_contents,node_datasources,node_usecases,node_kvstore,node_tokenlinks,node_rangemap toneRose
class node_operator,node_splunk toneIndigo
```

## Components

### Search profiling

- **Search activity**
- [Summary searches](https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/TA-search_profiling/default): `TA-search_profiling/default`
- [Profiling lookups](https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/TA-search_profiling/default): `TA-search_profiling/default`
- [Summary index](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SP-IndexCreation/default/indexes.conf): `SP-IndexCreation/default/indexes.conf`

### Search processing

- [Macro expansion](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/TA-search_profiling/bin/expandmacro.py): `TA-search_profiling/bin/expandmacro.py`
- [Boolean parsing](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/TA-search_profiling/bin/boolparse.py): `TA-search_profiling/bin/boolparse.py`
- [Multivalue matching](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/TA-search_profiling/bin/mvmatch.py): `TA-search_profiling/bin/mvmatch.py`

### Usage analytics

- [Usage dashboards](https://github.com/nmacroglou/search_profiling/tree/usecase_mapping/SA-search_profiling/default/data/ui/views): `SA-search_profiling/default/data/ui/views`

### Splunk interface

- [Dashboard behavior](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/dashboard.js): `SA-search_profiling/appserver/static/dashboard.js`
- [Content catalog](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/contents.js): `SA-search_profiling/appserver/static/contents.js`
- [Data source catalog](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/datasource_contents.js): `SA-search_profiling/appserver/static/datasource_contents.js`
- [Use case catalog](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/usecase_contents.js): `SA-search_profiling/appserver/static/usecase_contents.js`
- [KVStore Backbone](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/components/kvstore_backbone/kvstore.js): `SA-search_profiling/appserver/static/components/kvstore_backbone/kvstore.js`
- [Dashboard tokens](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/tokenlinks.js): `SA-search_profiling/appserver/static/tokenlinks.js`
- [Table icons](https://github.com/nmacroglou/search_profiling/blob/usecase_mapping/SA-search_profiling/appserver/static/table_icons_rangemap.js): `SA-search_profiling/appserver/static/table_icons_rangemap.js`

### Other components

- **Splunk owner**
- **Splunk platform**

## Connections

- Splunk owner → Usage dashboards: views usage (evidence: `README`)
- Search activity → Summary searches: summarized by (evidence: `README`)
- Summary searches → Profiling lookups: uses lookups (evidence: `README`)
- Summary searches → Summary index: writes summaries (evidence: `README`)
- Summary searches → Macro expansion: expands macros
- Summary searches → Boolean parsing: parses conditions
- Summary searches → Multivalue matching: matches fields
- Summary index → Usage dashboards: drives analytics (evidence: `README`)
- Splunk platform → Dashboard behavior: loads dashboard
- Splunk platform → Content catalog: loads catalog
- Splunk platform → Data source catalog: loads catalog
- Splunk platform → Use case catalog: loads catalog
- Dashboard behavior → KVStore Backbone
