Graylog2 / Graylog2/graylog2-server

Data Table Pivot Empty Repeated Value Toggle. And Export Data Table to CSV

Open
#14,523 0 comments 1 reaction 0 assignees View on GitHub
feature
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## What?

Pivot Column "empty" value when repeated value above.
![Screenshot_20230126_115618](https://user-images.githubusercontent.com/9088569/214868790-760e1fe6-c133-4e9a-9ac7-012d9c537039.png)

## Why?

I want to be able to enable/disable(toggle) "only pivot" column like this:
![Screenshot_20230126_115800](https://user-images.githubusercontent.com/9088569/214868992-e09496ad-d59b-4706-8ba9-fed9dcd2e9e1.png)

Is better to copy and paste on a report/email. So I create a Javascript to help me do that. But a think this is very helpful feature to have. Kibana presents it's data table this way. And has a "export to CSV" feature to export only the content of Data Table to CSV.

My Javascript code to "fill empty values":

```
var tables = document.getElementsByTagName('table');
for (var i = 0; i < tables.length; i++) {
var thisTable = tables[i];
var classTable = thisTable.getAttribute('class');
var rowLength = thisTable.rows.length;
if (classTable.includes("table table-striped table-condensed")) {
for (var ii = 0; ii < rowLength; ii += 1) {
var row = thisTable.rows[ii];
if (row.getAttribute('class') == "fields-row message-group") {
var cellLength = row.cells.length;
for (var iii = 0; iii < cellLength; iii += 1) {
var cell = row.cells[iii];
if (cell.innerHTML.includes("(Empty Value)")) {
row.remove();
break;
}
if (cell.innerHTML === "") {
cell.innerHTML = thisTable.rows[ii - 1].cells[iii].innerHTML;
}
}
}
}
}
}
```

## Your Environment

* Graylog Version: 5.0.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.