Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to capture bulletin messages in apache nifi

I want to know if there is a way to capture the bulletin messages(basically errors) that appear on the Nifi UI and store it in some attribute/file so that it can be looked upon later. The screen gets refreshed every 5 min and if there is a failure in any of the processors i would want to know the reason for it.

I am not particularly talking about the logging part here.

like image 704
Swati Sood Avatar asked May 25 '16 07:05

Swati Sood


1 Answers

As you know, the bulletins reflect the messages that are already logged. So all this content is already stored in the {NIFI_HOME}/logs/nifi-app.log. However, if you wanted to consume the bulletin directly you have a couple different options.

  • You could consume the bulletins from the REST API. There are a couple endpoints for accessing the bulletins.

http[s]://{host}:{port}/nifi-api/controller/process-groups/{process-group-id}/status?recursive=true

This request will get the status (including bulletins) of all components under the specified Process Group. You can use the alias 'root' for the root level Process Group. The recursive flag will indicate whether or not to return just the children of that Process Group or all descendant components.

http[s]://{host}:{port}/nifi-api/controller/status

This request will get the status (including bulletins) of the Controller level components. This includes any reported bulletins from Controller Services, Reporting Tasks, and the NiFi Framework itself (clustering messages, etc).

http[s]://{host}:{port}/nifi-api/controller/bulletin-board?limit=n&sourceId={id}&message={str}

This request will access all bulletins and supports filtering based components, message and limiting the number of bulletins returned.

  • You could also create a Reporting Task implementation which has access to the bulletin repository. Reporting Tasks are an extension point which are meant to report details from this NiFi instance. This would require some Java code but would allow you to report the bulletin's however you like. Here is an example that reports metrics to Ambari [1].

[1] https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/src/main/java/org/apache/nifi/reporting/ambari/AmbariReportingTask.java

like image 175
Matt Gilman Avatar answered Oct 17 '22 16:10

Matt Gilman