Integrating with TIBCO Spotfire

Spotfire can consume data from a Mashery Local database. To enable TIBCO Spotfire to consume logs, a separate service is required - the Mashery Local HTTP log consumer. The Mashery local HTTP log consumer takes the access logs and persists in a configured MySQL database. Supported logs include the Mashery Traffic Manager Access logs.

When you extract the TIB_mash-local_5.*_cf.tar.gz file, you will see a tml-spotfire folder which contains the artifacts needed for the TML-Spotfire integration.

Requirements

  • Java 1.8 or higher
  • MySQL Server 8.0, 5.7, 5.6, or 5.5
  • The Mashery local HTTP log consumer artifact - tml-http-log-consumer-1.0.zip

Preparing MySql

To prepare MySQL:
  1. Create users (if needed).
  2. Create schema and required tables. Use the provided SQL file mlaccesslogschema.sql file to create required database and tables.
  3. Provide permissions on newly-created database and table for the users.
  4. Enable remote access to schema for created users.
  5. After running the SQL, a database named masherylocallogs and a table named tmlaccesslog will be created.

Preparing the Mashery local HTTP log consumer

  1. Extract the contents of tml-http-log-consumer-1.0.zip (available in the TIB_mash-local-******.tar.gz).
  2. Use a text editor and open conf/application.properties.
  3. Provide the values for the following:
    1. spring.datasource.url - replace <hostname or IP address> with the proper db hostname or IP address. Ensure that the hostname and IP address are reachable.
    2. spring.datasource.username - replace <dbuser> with proper username.
    3. spring.datasource.password - replace <dbpassword> with actual creds

Starting the Application

Starting Mashery Local HTTP log consumer on Windows
cd C:\Users\Administrator\tml-http-log-consumer-1.0\bin
C:\Users\Administrator\tml-http-log-consumer-1.0\bin> run.bat
Starting Mashery Local HTTP log consumer on Linux
$ cd /home/User/tml-http-log-consumer-1.0/bin
$ chmod +x run.sh
$ ./run.sh

Testing the application

To test if the Mashery local HTTP log consumer is running correctly, run a curl command (or use a browser):
curl http://<hostname>:6080/logs
 
Expected Output
----------------
Log consumer is available
can consume : Access Logs

Configuring Mashery Local Log service to send logs to the Mashery local HTTP log consumer

  1. SSH into the tml-cm container/pod on your Mashery Local 5.x deployment.
  2. Prepare a config.json file with the following contents:
    {
    "td_agent_output_channelType" : "HTTP",
      "td_agent_out_http_URI" : "http://<hostname or ip address of Mashery local HTTP log consumer>:6080/logs/accesslog"
    }
  3. Name the files as /home/builder/config.json
  4. Use Cluster Manager to configure the log service to now send access logs to the Mashery local HTTP log consumer.
    tml-cm
    /home/builder $ clustermanager import config --componentType logservice --file /home/builder/config.json
    Example output example
    Updating the TMGC after the change
    Successfully updated the TMGC component c1057ef0-ab4e-459f-8413-0e5036c65b7c for components of type logservice
    Successfully imported configuration properties for the scope map[cluster:tml52clusterpune1 component:c1057ef0-ab4e-459f-8413-0e5036c65b7c zone:eastus] for components of type logservice