The REST log appender is responsible for transferring logs from Operation server to defined in your schema url.
Creating REST log appender with Admin UI
The easiest way to create a Cassandra log appender for your application is by using Admin UI.
It's also possible to create REST appender using Admin REST API .
The REST log appender configuration should match the following Avro schema:
Parameters for defining REST log appender
|host||a host of your custom service that will receive logs|
|port||port of service|
|ssl||boolean value that define whether or not use a SSL communication.|
|boolean value that define whether or not use a verification of SSL Certificate|
|name of user of your service (if authentication required)|
|password for user of service (if authentication required)|
|number of threads that can simultaneously perform operation with your service|
|header||boolean value that define whether or not use a Kaa header|
|path||define a path that will be able to receive logs from REST appender|
|mimeType||mime type which appender use for sending data|
|method||define a HTTP method that will be using for sending data|
The following configuration schema matches to previously introduced Avro schema:
Based on this configuration, you'd be able to perform "POST" request to 10.2.2.65:9000/encrypt url. Let's look at more definitive example.
Creating application that uses REST log appender
1.Log in Admin UI like admin and create an application. the following tutorial shows how to do it.
2.Log in as a tenant developer and create log schema in your previously created application:
upload the following configuration schema:
3. Go to Log appenders menu and add REST log appender to your app using your custom configuration:
your app-> Log appenders -> Add log appender
4. Write appropriate configuration for your appender and save results.
5.Then generate SDK appropriate to your platform. Add downloaded sdk to your project directory.
The following code snippet illustrates handling POST request from Kaa server:
The client code that sends logs to server might look like that:
After sending logs from client, Kaa server will use previoisly created REST log apppender which will send data to your custon service. based on above code you will see somethinf like that: