ts-test

The ts-test utility can tell you how PostgreSQL would parse a log and whether a given text search query matches that log.

Usage:

<rawDocument> [<tsQuery_inclStopwords>]

 

or

 

<path to file with rawDocument> [<tsQuery_inclStopwords>]

Example Output

If you invoke ts-test with a sample rawlog as the 1 arg, ts-test outputs a list of extracted terms and a detailed term extraction report table.

'The LCE agent at 192.0.2.10 [sensor: unknown] [type: networkmonitor v4.2.0.0] has been manually granted authorization to log in and send events to this LCE.'

In this example output, the top two rows indicate the following:

  • Token "The" was rejected by the human_language_rejecter.

  • Token " " was rejected because our config rejects the entire "Space symbols" category.

    Tip: Use the --detail-spaces option to show this information in the ts-test report.

  • Token "LCE" was rejected by whole_word_rejecter.

If you provide a query string (for example, 'Authorization'), ts-test indicates whether that query string matches the sample rawlog:

./ts-test 'The LCE agent at 192.0.2.10 [sensor: unknown] [type: networkmonitor v4.2.0.0] has been manually granted authorization to log in and send events to this LCE.' 'Authorization'

To see an example of match failure, provide a nonsense query string (for example, 'Bunnies?' ).

./ts-test 'The LCE agent at 192.0.2.10 [sensor: unknown] [type: networkmonitor v4.2.0.0] has been manually granted authorization to log in and send events to this LCE.' 'Bunnies?'