---
title: "Element: example"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-example/"
last_modified: "2023-08-29T16:01:35+02:00"
---

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

# Element: example

## Location

/[patterndb](https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-patterndb/index.md)/[ruleset](https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-ruleset/index.md)/[rules](https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-rules/index.md)/[rule](https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-rule/index.md)/[patterns](https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-patterns2/index.md)/[examples](https://axoflow.com/docs/axosyslog-core/4.28/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-examples/index.md)/*example*

## Description

OPTIONAL — A container element for a sample log message.

## Attributes

N/A

## Children

- *test_message*: OPTIONAL — A sample log message that should match this pattern. For example:

  ```xml
      <test_message program="myapplication">Content filter has been enabled</test_message>
  ```

  - *program*: The program pattern of the test message. For example:

    ```xml
        <test_message program="proftpd">ubuntu (::ffff:192.168.2.179[::ffff:192.168.2.179]) - FTP session closed.</test_message>
    ```
- *test_values*: OPTIONAL — A container element to test the results of the parsers used in the pattern.

  - *test_value*: OPTIONAL — The expected value of the parser when matching the pattern to the test message. For example:

    ```xml
        <test_value name=".dict.ContentFilter" type="string">enabled</test_value>
    ```

    - *name*: The name of the name-value pair to test.
    - *type*: The type of the name-value pair, one of the recognized syslog-ng type hints [Specifying data types in value-pairs](https://axoflow.com/docs/axosyslog-core/4.28/chapter-concepts/concepts-value-pairs/specifying-data-types/index.md)

## Example

```xml
   <examples>
        <example>
            <test_message>Accepted password for sampleuser from 10.50.0.247 port 42156 ssh2</test_message>
            <test_values>
                <test_value name="SSH_AUTH_METHOD">password</test_value>
                <test_value name="SSH_USERNAME">sampleuser</test_value>
                <test_value name="SSH_CLIENT_ADDRESS">10.50.0.247</test_value>
                <test_value name="SSH_PORT_NUMBER" type="integer">42156</test_value>
            </test_values>
        </example>
    </examples>
```

Last modified August 29, 2023: [Add documentation on the "type" attribute in test_value tag (#20) (355348a7)](https://github.com/axoflow/axosyslog-core-docs/commit/355348a7fa0614b1b04145966ca1ab6be070b3c2)
