| 1 | pattern: "(?P<level>\\w+)\\s+(?P<code>\\d+)\\s+(?P<message>.*)" |
| 2 | |
| 3 | # Test the prefix feature |
| 4 | prefix: LOG2JOURNAL_ |
| 5 | |
| 6 | inject: |
| 7 | - key: VERSION |
| 8 | value: "1.0" |
| 9 | - key: HOST |
| 10 | value: "localhost" |
| 11 | |
| 12 | rewrite: |
| 13 | # All captured groups should have the prefix |
| 14 | - key: SUMMARY |
| 15 | value: "${LOG2JOURNAL_level} ${LOG2JOURNAL_code}: ${LOG2JOURNAL_message}" |
| 16 | inject: yes |
| 17 | |
| 18 | # Test that injected keys also get the prefix |
| 19 | - key: FULL_VERSION |
| 20 | value: "v${LOG2JOURNAL_VERSION}" |
| 21 | inject: yes |
| 22 | |
| 23 | rename: |
| 24 | # Rename should work with prefixed names |
| 25 | - old_key: LOG2JOURNAL_level |
| 26 | new_key: LOG2JOURNAL_SEVERITY |
| 27 | - old_key: LOG2JOURNAL_code |
| 28 | new_key: LOG2JOURNAL_ERROR_CODE |
| 29 | |
| 30 | filter: |
| 31 | # Filter should work with prefixed names |
| 32 | include: "LOG2JOURNAL_.*" |
| 33 | exclude: "LOG2JOURNAL_message" # Exclude the raw message |