{
	"name" : "Top AS Exporter Iface",
	"i18n_name" : "top_as_exporter_if",
	"data_source" : "flows",
	"show_in_page" : "overview",
	"visualization_type" : "table",
	"hourly": true,
	"sql" : "SELECT ASN, IPv4NumToString(any(IPV4_ADDR)) IPV4_ADDR, IPv6NumToString(any(IPV6_ADDR)) IPV6_ADDR, IPv4NumToString(PROBE_IP) PROBE_IP, SNMP_INTERFACE AS snmp_interface, SUM(BYTES) AS total_bytes FROM ( SELECT SRC_ASN AS ASN, IPV4_SRC_ADDR AS IPV4_ADDR, IPV6_SRC_ADDR AS IPV6_ADDR, PROBE_IP, INPUT_SNMP AS SNMP_INTERFACE, (SRC2DST_BYTES+DST2SRC_BYTES) AS BYTES $FROM$ $WHERE$ AND SRC_ASN!=0 UNION ALL SELECT SRC_ASN AS ASN, IPV4_SRC_ADDR AS IPV4_ADDR, IPV6_SRC_ADDR AS IPV6_ADDR, PROBE_IP, OUTPUT_SNMP AS SNMP_INTERFACE, (SRC2DST_BYTES+DST2SRC_BYTES) AS BYTES $FROM$ $WHERE$ AND SRC_ASN!=0 AND OUTPUT_SNMP!=INPUT_SNMP UNION ALL SELECT DST_ASN AS ASN, IPV4_DST_ADDR AS IPV4_ADDR, IPV6_DST_ADDR AS IPV6_ADDR, PROBE_IP, OUTPUT_SNMP AS SNMP_INTERFACE, (SRC2DST_BYTES+DST2SRC_BYTES) AS BYTES $FROM$ $WHERE$ AND DST_ASN!=0 UNION ALL SELECT DST_ASN AS ASN, IPV4_DST_ADDR AS IPV4_ADDR, IPV6_DST_ADDR AS IPV6_ADDR, PROBE_IP, OUTPUT_SNMP AS SNMP_INTERFACE, (SRC2DST_BYTES+DST2SRC_BYTES) AS BYTES $FROM$ $WHERE$ AND DST_ASN!=0 AND OUTPUT_SNMP!=INPUT_SNMP ) AS f $GROUPBY$ $ORDERBY$ $LIMIT$",
	"select" : {
		"items" : [
			{
				"name" : "ASN",
				"func" : "",
				"value_type" : "asn"
			},
			{
				"name" : "PROBE_IP",
				"func" : "",
				"value_type" : "probe_ip"
			},
			{
				"name" : "snmp_interface",
				"func" : "",
				"value_type" : "snmp_interface"
			},
			{
				"name" : "total_bytes",
				"func" : "",
				"value_type" : "bytes"
			}
		]
	},
	"filters" : {
		"items" : [
			{
				"name": "SRC_ASN",
				"op": "neq",
				"value": "DST_ASN",
				"value_type": "number",
				"input": "fixed"
			}
		]
	},
	"groupby" : {
		"items" : [
			{
				"name" : "ASN"
			},
			{
				"name" : "PROBE_IP"
			},
			{
				"name" : "snmp_interface"
			}
		]
	},
	"sortby" : {
		"items" : [
			{
				"name" : "total_bytes",
				"order" : "DESC"
			}
		]
	}
}
