Skip to content

Instantly share code, notes, and snippets.

@sduff
Last active October 3, 2017 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sduff/a33410b0311b302601e12148df37c8f7 to your computer and use it in GitHub Desktop.
Save sduff/a33410b0311b302601e12148df37c8f7 to your computer and use it in GitHub Desktop.
Splunk Custom Visualisation code to convert data.fields and data.rows into a hash map
data.rows.map(function (row) {
var _row = {};
for (var f=0; f<data.fields.length; f++) {
fn = data.fields[f].name;
_row[fn] = row[f];
}
return(_row);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment