# Options add-contextual-data()

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

## Required options:

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

## database()

|   
---|---  
Type: | .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:
```
 
       unknown-hostname,host-role,unknown
    
```

In the AxoSyslog configuration file:
```
 
       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 [Using filters as selector](../../../docs/axosyslog-core/chapter-enrich-data/data-enrichment-add-contextual-data/add-contextual-data-filters/index.md).

  * To use shell-style globbing (wildcards) in selectors, see [Shell-style globbing in the selector](../../../docs/axosyslog-core/chapter-enrich-data/data-enrichment-add-contextual-data/add-contextual-data-globs/index.md).

  * Using templates as selectors is not supported.




Last modified July 2, 2023: [Change highlight mode of code examples (2f8a9593)](<https://github.com/axoflow/axosyslog-core-docs/commit/2f8a95937c6498193e7168ce8b0dc831e9f0f8ad>)