Skip to content

Wilma Message Search Application

Tamás Kőhegyi edited this page Mar 9, 2015 · 12 revisions

Introduction

When Wilma logs a lot of messages, it is hard to search for a specific message or messages those contain a certain text. To help this, Wilma Message Search Application was created, that is a Lucene index based search tool for the messages logged by Wilma instance(s).

Requirements

Java Development Kit 7 is required for running Wilma Message Search Application. (http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)

Getting the latest release

You may get the latest Wilma Message Search Application from the Release page: Search for wilma-message-search-<version>.zip file, that contains everything that's needed to run the tool.

Configuring the tool

After downloading the zip file, unpack its contents to a selected folder. To run Wilma Message Search Application, it should be configured first in message.search.conf.properties.

This configuration file must contain the following property entries (the values here are examples):

# the port used by the web application
webapp.port=9093

# port used to communicate with message producers via an activemq broker
jms.broker.port=16161

# the folder the application stores the index files
lucene.index.folder=d:/lucene-test/index

# the comma separated list of directories that will be indexed by the application
message.folders=d:/lucene-test/files_temp,D:/git/wilma/wilma/modules/wilma-engine/messages

#the cron expression which defines when the reindexing is run
lucene.reindex.cron=0 0 4 * * ?

Running the tool

After the configuration is done, you can run Wilma Message Search application by entering the following command: java -jar message-search-<version>.jar message.search.conf.properties

Usage

Using searching page

After opening the application home page you can simply search for textual content in the logged files using the search bar. In the search input field you can add complex query using the Lucene query syntax.

The following picture represents an example search:

example search

 As you can see in the picture one row contains a result and the result's appropriate request or response pair. Every result file can be downloaded clicking on the link (which is some kind of path) and opened in a new browser tab clicking on the "[Source]" link. With the "Download All" button all of the results can be downloaded in a single zip file.

Using parameterized HTTP Get

To search and download the search results in one step you can use a simple HTTP Get which is targeting the "/search" path of the application with a "text" parameter which contains the search query (Lucene query syntax) as the following code block presents. This way the searches can be easily automated.

curl -o output.zip http://wilma-message-search-host:port/search?text=*something:that_identifies_a_response%20AND%2020131025154435.0004

Important notes

  • Index can be corrupted when indexed files are not deleted by Wilma. In this case the index will contain the "manually" deleted files and the searches will return with corrupt result. The simplest way to solve this problem is shutting down the Wilma Message Search Application and deleting the corrupted indexes or simply restarting the application and let the indexing mechanism to repair the corrupted index. 
  • There is a cron expression in the config file. Based on that, the application runs a full-re-index cycle regularly.
  • It is also possible to initiate a message re-indexing manually by sending a HTTP Get targeting the "/reindex" path of the application.
  • It may happen that Wilma Message Search cannot start properly if Wilma application is running. In such case ensure that when Wilma Message Search application is started (or restarted), the Wilma Application is not running.
  • Meanwhile reindexing is running, the Message Search function may be delayed till the end of the reindexing procedure.
  • Always give enough heap to Wilma Message Search application. In case of OOM exception, the application will try to exit immediatelly.
Clone this wiki locally