gretamosa / gretamosa-topology-panel

Sigma.js graph plugin for Grafana
GNU General Public License v3.0
8 stars 2 forks source link

Built the updated Plugin but does not seem to work with Grafana v6.0.2 #4

Closed BenB196 closed 5 years ago

BenB196 commented 5 years ago

I built the new version of the plugin, but all I get when I try to use it is a Request Error. I am using a Elasticsearch data source. Is this plugin not completely updated for 6.0?

image

Query for panel:

image

Visualization for panel:

image

gretamosa commented 5 years ago

Could you give me more detail from the request error? put the cursor over the exclamation mark.

BenB196 commented 5 years ago

Hi, there is literally no more detail provided. In the first screen shot, that is with the cursor over the exclamation mark. It appears that the query itself returns successfully, with data being returned.

image

BenB196 commented 5 years ago

Looking at the web console the following error is displayed:

Panel data error: The node must have a string or number id. metrics_panel_ctrl.ts:178:11

image

gretamosa commented 5 years ago

Could you try to refresh panel once select "Source Field" and "Destination Field"?

BenB196 commented 5 years ago

I did as requested and refreshed the panel after setting the Source and Destination Fields. However, I got the same issue. Just to make sure that the dashboard was actually reloading as well, I saved the dashboard, left the dashboard, and came back to the dashboard, but got the same error message.

gretamosa commented 5 years ago

After reviewing your configuration, I've seen fields like _netflow.inbyt or netflow.hostn. Do you have nested fields in Elasticsearch? AFAIK it is not supported from Grafana core (https://github.com/grafana/grafana/pull/7863#issuecomment-354004166)

BenB196 commented 5 years ago

I am not sure if I am understanding you correctly. It seems like you are saying that nested fields do not work. ie: netflow.in_bytes.

Should I add an addition field that is at root level that just copies the nested? ie: netflow.in_bytes -> in_bytes

Here is a basic example of what a document looks like:

{ "_index": "logstash-netflow-daily-2019.03.27", "_type": "doc", "_id": "cfchv2kBdDAt_D-Mv8jx", "_version": 1, "_score": null, "_source": { "netflow": { "protocol": 6, "output_snmp": 4, "last_switched": "2019-03-27T12:28:21.999Z", "l4_dst_port": 49155, "hostname_src_addr": "172.18.76.62", "l4_src_port": 61234, "dst_as": 0, "src_as": 0, "direction_name": "Ingress", "protocol_short_name": "TCP", "protocol_long_name": "Transmission Control", "flowset_id": 256, "tcp_flags_name": "ACK, PSH, SYN", "hostname_next_hop": "10.252.252.21", "flow_sampler_id": 0, "tcp_flags": 26, "direction": 0, "in_bytes": 1023, "ipv4_src_addr": "172.18.76.62", "ipv4_dst_addr": "192.168.76.202", "flow_seq_num": 359006060, "hostname_dst_addr": "<redacted>", "in_pkts": 6, "src_mask": 24, "src_addr_locality": "Internal", "dst_addr_locality": "Internal", "version": 9, "input_snmp": 8, "first_switched": "2019-03-27T12:28:20.999Z", "src_tos": 0, "ipv4_next_hop": "10.252.252.21", "next_hop_locality": "Internal", "dst_mask": 24 }, "@version": "1", "host": "10.63.0.8", "@timestamp": "2019-03-27T12:28:24.000Z", "hostname": "<redacted>" }, "fields": { "netflow.first_switched": [ "2019-03-27T12:28:20.999Z" ], "@timestamp": [ "2019-03-27T12:28:24.000Z" ], "netflow.last_switched": [ "2019-03-27T12:28:21.999Z" ] }, "sort": [ 1553689704000 ] }

gretamosa commented 5 years ago

Exactly, unfortunately Grafana does not support ES nested fields for the moment. However, as your proposed, if you copy fields to root level (i.e. removing nesting / flat) it should work.

BenB196 commented 5 years ago

After adding additional fields that are not nested. The plugin now works, thank you for helping me find a solution to the problem. The plugin works really well.