Users can make use of the Gateway-SQL plugin, which provides a way to summarise and reformat dataviews on the same gateway. The plugin has been available since gateway version GA3.0.15 (GWX-1949). This article provides an example with the group_concat() function. |
We have picked the Gateway-Managed Entities Data plugin as an example for the source data. We are interested in rows that are reported as Warning or Critical severity. In this example, there are 2 in Warning severity and 1 in Critical severity as highlighted above. We will create a new dataview using the Gateway-SQL plugin. At the Tables option, it takes the XPath of the original dataview like a database table. We only need to define 1 table here and we use T1 as the table name. At the Views option, it accepts SQL syntax to manipulate data from the source. The GROUP BY clause is used to combine the data based on severity. The group_concat() function merges the ME names to a single row, and we use ', ' as separator. SELECT severity, group_concat(name, ', ') AS me_names, count(*) AS me_count The resulting dataview looks like the below. As you can see, the Managed Entities are grouped nicely based on the severity. Additional gateway rules can be applied based on this new view. |
|
Further ReadingUsers can check out the Gateway-SQL section in Gateway Reference Guide. The SQL statements are based on SQLite, which is described at https://www.sqlite.org/lang.html. |
Comments
0 comments
Please sign in to leave a comment.