---
title: "Options add-contextual-data()"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-enrich-data/data-enrichment-add-contextual-data/reference-add-contextual-data-options/"
last_modified: "2026-05-28T13:15:32+02:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# Options add-contextual-data()

The `add-contextual-data()` has the following options.

## Required options

The following options are required: `selector()`, `database()`.

## database()

|  |  |
| --- | --- |
| Type: | `<path-to-file>.csv` |
| Default: |  |

*Description:* Specifies the path to the CSV file, for example, `/opt/syslog-ng/my-csv-database.csv`. The extension of the file must be `.csv`, and can include Windows-style (CRLF) or UNIX-style (LF) linebreaks. You can use absolute path, or relative to the `syslog-ng` binary.

## default-selector()

|  |  |
| --- | --- |
| Synopsis: | default-selector() |

*Description:* Specifies the ID of the entry (line) that is corresponds to log messages that do not have a selector that matches an entry in the database. For example, if you add name-value pairs from the database based on the hostname from the log message (`selector("${HOST}")`), then you can include a line for unknown hosts in the database, and set `default-selector()` to the ID of the line for unknown hosts. In the CSV file:

```shell
   unknown-hostname,host-role,unknown
```

In the AxoSyslog configuration file:

```shell
   add-contextual-data(
        selector("$HOST")
        database("context-info-db.csv")
        default-selector("unknown-hostname")
    );
```

## ignore-case()

|  |  |
| --- | --- |
| Synopsis: | ignore-case() |
| Default: | ignore-case(no) |

*Description:* Specifies if selectors are handled as case insensitive. If you set the `ignore-case()` option to `yes`, selectors are handled as case insensitive.

## prefix()

|  |  |
| --- | --- |
| Synopsis: | prefix() |

*Description:* Insert a prefix before the name part of the added name-value pairs (including the pairs added by the `default-selector()`) to help further processing.

## selector()

|  |  |
| --- | --- |
| Synopsis: | selector() |

*Description:* Specifies the string or macro that AxoSyslog evaluates for each message, and if its value matches the ID of an entry in the database, AxoSyslog adds the name-value pair of every matching database entry to the log message. You can use the following in the `selector()` option.

- Strings
- A single macro (for example, `selector("${HOST}")`)
- To use filters as selectors, see [`selector(filters())`](https://axoflow.com/docs/axosyslog-core/4.28/chapter-enrich-data/data-enrichment-add-contextual-data/reference-add-contextual-data-options/index.md#add-contextual-data-option-selector-filters).
- To use shell-style globbing (wildcards) in selectors, see [`selector(glob())`](https://axoflow.com/docs/axosyslog-core/4.28/chapter-enrich-data/data-enrichment-add-contextual-data/reference-add-contextual-data-options/index.md#add-contextual-data-option-selector-glob).
- Using templates as selectors is not supported.

### selector(filters())

|  |  |
| --- | --- |
| Synopsis: | selector(filters()) |

*Description:* Use filters as selectors to look up entries in the database. For details and examples, see [Using filters as selector](https://axoflow.com/docs/axosyslog-core/4.28/chapter-enrich-data/data-enrichment-add-contextual-data/add-contextual-data-filters/index.md).

### selector(glob())

|  |  |
| --- | --- |
| Synopsis: | selector(glob()) |

*Description:* Use shell-style globbing (wildcards) in selectors to look up entries in the database. For details and examples, see [Shell-style globbing in the selector](https://axoflow.com/docs/axosyslog-core/4.28/chapter-enrich-data/data-enrichment-add-contextual-data/add-contextual-data-globs/index.md).

Last modified May 28, 2026: [Sync add-contextual-data options with cfg-helper (82b6246a)](https://github.com/axoflow/axosyslog-core-docs/commit/82b6246a866fc6a02ae6a2213049bb7ab27d3d1d)
