← Back to front page

Liferay and Splunk – Beautiful Together

Splunk and Liferay. First one is targeted to handling data and second one for viewing it. Honestly, they can do other things too, but my point of view need some strict borderlines. Splunk have some pretty cool ways to view charts, lists and other stuff (I think it can even view maps). And of course Liferay can handle data too, it’s an application framework. But now, splunk handles and liferay views. Separation of concerns and layers that have clean responsibilities, that’s what I want as an architect.

We have been building one kind of dashboard to one of our customers, or actually customer’s customers, and it’s intranet. Maps, charts and lists and interactions between them. And part of the data comes from Splunk instance. As I said before, Splunk can view some pretty cool data visualizations too, but in our case we need centralized authentication (SSO) and authorization and also combination of charts with other views, like maps and lists. So we decided to do visualizations at Liferay’s side of system. At POC phase we used Leaflet API for map (leaflet offers very pretty interface for maps and layers on them) and Google Chart api for charts. And Splunk’s cool Java api for querying data from background.

Why it’s cool? In my opinion, it’s quite simple but still versatile. You can find usage examples from here. But basically you can do asynchronous or synchronous queries using Splunk search language, select how to format your result (JSON, XML, CSV), integrate results to your application and of course login into that system. We did little transformation at the portlets controller class and that’s it: we could return JSON to our portlet’s view.

At the view (which is actually JSP-page) we used some pretty cool JavaScript trick, that Liferay offers us: client side inter-portlet communication with using Liferay JavaScript event system. We have map portlet which have map view with some markers on it. When you click that marker, it fires event. Every portlets on that page can register itself to listening that particular (or other) event. At the chart portlet that event triggers asynchronous ajax call to controller, which does query to Splunk and returns results in JSON format. Google chart api uses that JSON data to draw chart. Actually, with that event system you can add other portlets too, which are updated using that event system. And they are very loosely coupled: sending end doesn’t know anything about them.

These very lightweight technologies offer clean way to do some pretty cool interactions and visualizations in a portal. And there is not so much job to do if you want to move all that stuff on other platform like Grails or plain old Spring MVC.

Liferay and Splunk are a beautful combination. If you want to know more about the combo, just e-mail me or ask me on twitter,


Please, leave us a message and we'll contact you.
You can also contact our Service Desk by phone +358 290 010 500 or email servicedesk@ambientia.fi.