Getting Started - Configuring Configuration Options - Basics

Getting Started - Running a Simple Veduta™ Example

We have three configurations in the examples\simple directory:
  1. The system configuration veduta.xml
  2. The consumers.xml specifying the log files to read
  3. The report.xml, specifying how to generate the reports
To run Veduta against this. simply run the below to start the server:
> java -jar veduta-complete.jar -d examples\simple -webserver
and the below to start the client:
> java -jar veduta-complete.jar -d examples\simple -client
(assuming that the .jar file is in the current directory. Note that the -d tells Veduta to pick up a set of configs from a given directory.)

Now point your browser to:

http://{your host name}:8080/
to view the results.

More Advanced Log File Parsing

The example above works, but Veduta hasn't been configured to read the time stamps in the log files. So Veduta will assume that each line read will have the timestamp corresponding to when Veduta read that line. We can configure Veduta to read and understand the timestamps. This gives us more accurate readings and allows us to parse log files that have been written prior to starting Veduta.

To do this we need to look at the format of the log file, and modify examples\simple\consumers.xml appropriately. The log file lines look like:

Sep 2 09:38:29 dali kernel: evdev_connect: evdev .....
so we want Veduta to identify the date/time stamp. In consumers.xml replace:
      <parser type="simple"/>
with:
      <parser type="timestamped">
        <pattern dateIndex="1" messageIndex="2">^(.{15}) (.*)$</pattern>
        <dateformat currentDate="false" currentYear="true">MMM dd HH:mm:ss</dateformat>
      </parser>
You can do this simply by commenting/uncommenting the appropriate sections in the example configuration. For those unfamiliar with XML comments, you need the following:
      <!-- parser type="simple"/ -->
      <parser type="timestamped">
        <pattern dateIndex="1" messageIndex="2">^(.{15}) (.*)$</pattern>
        <dateformat currentDate="false" currentYear="true">MMM dd HH:mm:ss</dateformat>
      </parser>
(<-- and --> are XML comments).

This tells Veduta to parse the log lines and expect to find a timestamp. We have to tell Veduta two things:

  1. Where in the line the timestamp is, and
  2. How to read it as a valid time
To identify the timestamp we provide a regular expression and mark which matching parts match the timestamp. In the above config:
        <pattern dateIndex="1" messageIndex="2">^(.{15})(.*)$</pattern>
identifies the first group of 15 characters (.{15}) (grouped by the brackets) as being the date (dateIndex="1"). Similarly:
        <pattern dateIndex="1" messageIndex="2">^(.{15}) (.*)$</pattern>
identifies the second group of characters (.*) as being the message (messageIndex="2").

The timestamp format in the above config is identified using:

        <dateformat currentDate="false" currentYear="true">MMM dd HH:mm:ss</dateformat>
where MMM dd HH:mm:ss is used to parse the timestamp (e.g. see the above example timestamp of Sep 2 09:38:29). This timestamp does not identify the year, so we instruct Veduta to use the current year (currentYear="true"). Because the timestamp does identify the date, we instruct Veduta not to use the current date (currentDate="false").

See here for more info on configuring for timestamps etc. Check here and the examples subdirectories for suitable examples.

Running The Modified Veduta™ Example

You can now run Veduta again (as above) using the new consumers.xml configuration. To run Veduta against this. simply run the client again:
> java -jar veduta-complete.jar -d examples\simple -client

Veduta will recreate the reports as before, but is now parsing the log files to determine timestamps accurately. This time you will see a set of reports generated according to the timestamps in the log file, and you can step forwards/backwards through time.

Getting Started - Basics Configuration Options - Basic Options