Wednesday, March 22, 2017

How to split large log files into smaller files in Linux.

If for instance you were wanting to break a large wso2carbon.log file down so that it can be read for analyzing, you could use the split command with the -bytes flag.

Command:

split [option] [input] [output]


For example you wish to break a 5GB file into files of 1G size (wso2carbon.log.2017-03-18) use below command.

split -b 1G -d wso2carbon.log.2017-03-18 carbonlog-part


Your split potions will be as below:

Tuesday, March 21, 2017

How to search messages in WSO2 ESB Analytics Server using Lucene Query Syntax.

Please refer documentation [1] to configure WSO2 ESB with WSO2 ESB Analytics for monitoring.

Use-case: Lets assume you have list of messages published to ESB as below and you are required to search a specific message in ESB Analytics.



Before searching for a specific criteria we could look into the corresponding table to identify the key words to search. Please find the table below for reference.


1. Searching based on the message ID 

Lucene syntax for messageid 

messageFlowId:"urn_uuid_3586f01a-62ab-45fd-b017-90703088e8bc431453695069265"


2. Searching based on the payload

Lucene syntax for afterpayload

afterPayload:"AAA"


3. Searching based on the Status.

Lucene syntax for status "success"

faultCount: "0"


Lucene syntax for status "failed"

faultCount: "1 "

For more information on using Query Language Reference please refer [2]

[1] https://docs.wso2.com/display/ESB50/Monitoring+WSO2+ESB+with+WSO2+ESB+Analytics
[2] https://docs.wso2.com/display/DAS300/Query+Language+Reference