Hello,
I have some events that where created:
In file 1:
{"souceNetwork":"cc567", "sourceDevice":"z01", "destinationNetwork":"cc567", "destinationDevice":"z02", "path":"/user/file1"}
{"sourceNetwork":"cc567", "sourceDevice":"z01", "destinationNetwork":"cc567", "destinationDevice":"z06", "path":"/user/file1"}
{"sourceNetwork":"cc567", "sourceDevice":"z02", "destinationNetwork":"cc567", "destinationDevice":"z06", "path":"/user/file1"}
{"sourceNetwork":"cc567", "sourceDevice":"z01", "destinationNetwork":"cc567", "destinationDevice":"z04", "path":"/user/file1"}
In file2:
{"sourceNetwork":"cc567", "sourceDevice":"z01", "destinationNetwork":"cc567", "destinationDevice":"z02", "path":"/user/file2"}
And there can be more files. Also all the device are in kibana as strings.
Now what I am trying to do is create a bar graph using Vega where on the X axis it shows the path and the y axis is a bit more complicated.
I want it to have the unique count of sourceDevice and destinationDevice together. So for example:
-for file 1 the sourceDevices are z01, z02 and the destination devices are z02, z06, z06, z04. So the bar for path 1 should be at 4 high because z02 is in both list and z06 is in there twice so they are counted once.
-for file 2 which would be the next bar in the graph it would only be 2 because there are only 1 sourceDevice and 1 destinationDevice that are unique.
I also wanted the data to be split in the bar graph so that you can hover over it and see that z01, z02, z06, z04 are in the one bar and then in the next bar only z01, z02 are in it.
I was trying to do this and vega and it would not even get it to get the correct data from kibana.
I was referencing this: How to make histogram by grouped aggregation count?
I could get data counts to appear, but could not get it to sort by paths on the x axis or even add destination data to the source data. I can do this without vega with just sourcData, but I would like to do it with the sourceDevices and destinationDevices combined.