# Element: example

## Location

/[patterndb](../../../../../docs/axosyslog-core/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-patterndb/index.md)/[ruleset](../../../../../docs/axosyslog-core/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-ruleset/index.md)/[rules](../../../../../docs/axosyslog-core/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-rules/index.md)/[rule](../../../../../docs/axosyslog-core/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-rule/index.md)/[patterns](../../../../../docs/axosyslog-core/chapter-parsers/chapter-patterndb/reference-parsers-pattern-databases/reference-patterndb-schemes/patterndb-scheme-patterns2/index.md)/[examples](../../../../../docs/axosyslog-core/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:
```
 <test_message program="myapplication">Content filter has been enabled</test_message>
        
```

    * _program_ : The program pattern of the test message. For example:
```
 <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:
```
 <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](../../../../../docs/axosyslog-core/chapter-concepts/concepts-value-pairs/specifying-data-types/index.md)



## Example
```
       <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>)