I have completed a POC on ELK Stack in my organization and I am currently trying out few use cases that some of the Business users suggested.
So I have the data of each Trade that went through us and has column like Type, Price Movement, P&L, etc.
Ex:
**Type
ISIN
Price Movement
P&L**
F
R1------
0.2
10
F
R2------
0.1
-2
R
R3------
-0.1
3
Now I want to generate a report in following format on Kibana from the above data that is stored in Elasticsearch :
Total no. of trades : Count ( Trades where Type = F ) | Percentage ( 100% here) | Total P&L
Total no. of Negative Price Movement trades : Count (Trades where Type = F and Price Movement < 0) | Precentage = Count of previous column / Total no F trades | Sum of P& L
assuming the transactions are represented as individual documents with fields like a type (as a keyword), price_movement (as a number) and p_and_l (as a number), you should be able to let Kibana calculate some of those numbers using filters and aggregations, e.g.
total no of trades: a filter "type is F" with the Count aggregation
total p&l: a filter "type is F" with the Sum aggregation on the p_and_l field
total no of neg. trades: filters "type is F" and "price_movement less than 0" with the Count aggregation
total neg. trades p&l: filters "type is F" and "price_movement less than 0" with the Sum aggregation on the p_and_l field
You could visualize these values as metrics (single values) or line/bar charts (over time).
The percentages require script aggregation usage, which the normal Kibana visualization UI does not support yet.
However, can we have different aggregations using different filters in the same Visualization? My requirement is to get all the relevant data in one single place (and not in Dashboard preferably)?
Also, as I am currently trying Scripted Fields I am almost done except the percentage part where I need to calculate sum of P&L of cat-1 / sum of Total P&L . It will be great if you can give me some pointers on how to resolve this.
Combining all this in a single visualization could be difficult. That's exactly what the dashboards are meant to do. What keeps you from using those?
Calculating ratios across documents can not be done using scripted fields. The Time Series Visual Builder has a "Filter Ratio" aggregation, that can do that though:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.