Find answers to your NQE questions and share NQEs you've developed.
Recently active
parserecords(ep) = foreach x in [0] let recordid = extractJson[{ kind: String, selfLink: String, items: List<{ subList:List List<{ kind: String, selfLink: String, name: String }> }> }]foreach hs in network.externalSources.httpSourcesforeach ep in hs.endpointswhere ep.name == "endpointname" && ep.statusCode == 200let recordItems = (min(parserecords(ep))).itemsforeach i in recordItemsselect { SrcName: hs.name, subListName: i.subList.name}///////////////////////// Oops! The query doesn't work ///////////////Address the following issues: - Line xx, character xx: Can't access field 'name' from 'i.subList', because that is a List<{kind: String, selfLink: String, name:String}>.
A custom source API call returns a date field in microseconds format. Does NQE have a built in function to convert? For example, 1725899407, to Sept. 9, 2024. Currently I don’t need the hours and minutes but in the future it may be necessary. I’ve searched “date” and “microseconds” in the documentation and online without success.
Borrowing a capture of the Results window from another post on this site for reference, is it possible to filter for values that are not present?For example, instead of “cisco” could I return records that are !=cisco. I understand I have the options to write it in the NQE or export into Excel and filter as a spreadsheet but it would be useful to have the ability to filter other comparison operators on the fly in the Results window.
Is there a command equivalent to str(X) in Forward Networks?
For a user defined function as follows, can it be used to return a number or does it only return a Bool value? threshold : Number = 100;hasManySubInterfaces(iface) : Bool = length(iface.subinterfaces) > threshold; Say something like the following, is that possible? threshold : Number = 100;hasManySubInterfaces(iface) : Number= length(iface.subinterfaces) + threshold;
Is there any way to order the results in the NQE output ? E.g. order by field A then field B This would be within the query rather than once the results are shown in the table below the query itself.
Hi All, Can you please help me to write a NQE query for all ip details where BGP Admin status id is showing down.
Custom source profile with Endpoint that is using “url/path?_return_type=json-pretty” but responseBody is one long line.I attempt to use splitJsonObjects; however, it isn’t returning in a structured layout for me to pattern match.
In Part 1 of Best way to start writing a Parser I described how you can start writing a parser without running it against a snapshot, which can save a lot of time.I ended it with parsing the interface out of a device output blob.This Article will extend the same NQE, but I will extend the content of the information that we will be parsing for.As a reminder, here the final NQE from Part 1:test_string ="""GigabitEthernet0/0 is up, line protocol is up (connected) MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 1000Mb/s, media type is RJ45 output flow-control is XON, input flow-control is XON ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:00, output hang never Last clearing of "show interface" counters 25w3d Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: Class-based queueing Output queue: 0/1
Are you new to NQE?Do you need to write a pattern match parser but don't know where to start?Do you want to test your pattern match without running it against your snapshot, because it takes too long for each iteration?Well, I have been there and here's what I've learned.If you start writing a parser, you'll most likely run into multiple iterations that won't give you the desired results. If you're as impatient as me, you'd like to get your test results quickly back so you can adjust the parser.To do this, you can:Take a sample of the config or device output and store it in a variable. Write the parser to run against this sample. Check if the result is what you expect. Modify the parser and run step 3 until you get your expected results.Well, that sounds easy enough! But how do you actually do each of these steps?Here's an example.For example, lets assume you have to lookup information from the "show interfaces" command on Cisco devices, something like this:GigabitEthernet0/0 is up, li
what is format to pass the the path parameter in Path Mtu consistency check ?is it a list of devices ? is it a traceroute ?or source or destination ip ?
How would one replicate the OneIP table with NQE, including info such as IP address, MAC address, vendor, switch name and switch port?
I have an already pretty extensive NQE written to return a half dozen or so fields, but I cant figure out how to differentiate whether the CVE returned is a OS or Config match...or both. Can someone help with that code?
Has anyone put together a simple Query to grab the advertised routes to a BGP Peer?I haven’t had much time to try, but maybe someone has done this on side.In summary, I want to try and associate routes to a device/location in our branch environment.foreach device in network.deviceswhere "Branch" in device.tagNames && "WAN" in device.tagNames I thought there would be some simple query in the model to just pull ‘bgp advertised routes’ and I could limit it with the above, and associate that route to that location. But after looking for 10 min, I couldn’t find anything of use. Anyway, if anyone has done something, it would be great to see/try. I saw a very ‘wild’ one on the community @baher , amazing work BTW.But i’m basically looking for the result of the routes advertised to any BGP neighbor.
Hello: I am not sure if this should be a discussion or question so apologies on that. I have an NQE where I am pulling the raw Oid data and displaying the rawValue result as an output. I want to be able to name each of those outputs so that its know to the public what that raw data represents. One such example is a returned value of INV: 2.12 in the rawValue field. But I would like to have know as hardware revision.I did apply names to the Oids in the custom source profile, but its not pulling that. Can this be done?
Hi Team,We want to fetch the Cloud objects difference count that compare today and yesterday(For example) Snapshot and provide the missing Cloud objects details which are missing from Current snapshot through NQE Query. Please assist us if anyone can relate with this.
This is a good example of how NQE can work well with IP subnet information.In this case the customer had found that the router's parser would not exclude misconfigurations. They found that some of the NHRP configuration commands had used the incorrect subnet. The correct IP configs were there as well, but now it means there are extra config lines and it would be nice to clean these up. There were under 100 devices that were violations out of the tens of thousands of devices that were collected.Config segment from Cisco router with a violation.!interface Tunnel0 ip address 10.16.1.16 255.255.255.0 ip nhrp map multicast 172.16.16.1 ip nhrp map 10.6.16.1 172.16.16.1 <<--This command does not match the tunnel subnet ip nhrp map multicast 192.168.16.1 ip nhrp map 10.16.1.1 192.168.16.1 ip nhrp network-id 16 ip nhrp nhs 10.16.1.1!/** * @intent Find ip nhrp commands that are not in the same subnet as the tunnel subnet * @description The 'ip nhrp map' and 'ip nhrp nhs' address should be
I wrote a basic NQE script to obtain the uptime for devices and display them in years, days and hours. When i reviewed the results I saw some super robust devices out there that had not been rebooted for several years.This led to some discussion about whether uptime could be used in part to determine in device software upgrades were taking place regularly. As such we developed a really basic uptime check and threshold of around 6 months. Any devices that been up longer than 6 months would definitely have not been upgraded. (Our devices all reboot for software patches and upgrades).This script is below/*------------------------------------------------------------------------------------------------------------ * thresholdDays the number of days before uptime is not acceptable. ------------------------------------------------------------------------------------------------------------*/thresholdDays = 183;/*---------------------------------------------------------------------------------
Is there any additional documentation as to what needs to be included in any NQE query that is used to dynamically create l3vpn synthetic devices ?
How can i collect NQE Query Data from Forward Network to Power BI Easily,
Hi All,Need to fetch interface alias details of Fortinet firewalls from NQE query. Please help me to build the logic.
Hi Team,I want to add only admin status up interfaces condition, CDP LLDP neighbor info in below query, please help me on this.Extra question- 1. any method to shirk the results to only getting WAN interfaces any idea on this.2. want to add one more column to fetch circuit id details from Interface or Interface description.NQE Query- pattern_interfaces = ["*WAN *"];testPatterns(s, p) = max (foreach pattern in pselect matches(toLowerCase(s), toLowerCase(pattern)));foreach device in network.devicesforeach interface in device.interfaceslet platform = device.platformlet ethernet = interface.ethernetwhere isPresent(interface.description)where testPatterns(interface.description, pattern_interfaces)select { test: testPatterns(interface.description, pattern_interfaces), deviceName: device.name, Location: device.locationName, Tags: device.tagNames, Vendor: platform.vendor, Model: platform.model, interfaceName: interface.name, negotiatedSpeed: ethernet.negotiatedPortSpeed, negotiatedMod
I want to create a custom interface description nqe query in Forward Networks.Requirement is to getting only WAN, INT interfaces information through the query. I have used below logic through it i am not getting the results. Please help me out. foreach device in network.devicesforeach interface in device.interfaceslet platform = device.platformwhere interface.description=="WAN"select { deviceName: device.name, Location: device.locationName, Tags: device.tagNames, Vendor: platform.vendor, Model: platform.model, interfaceName: interface.name, description: interface.description,operStatus: interface.operStatus,adminStatus: interface.adminStatus,cdpNeighborsCount: length(interface.cdp.neighbors), lldpNeighborsCount: length(interface.lldp.neighbors) }
Sorry about the lack of punctuation in the title, I can’t edit after ;-)So I don’t know if this is possible, but maybe someone has an idea.The script below provides the following output:OutputThe goal of the script is to figure out how ‘over provisioned’ we are on a switch. i.e. how many ports have never passed a packet. This is in order to size environments better for future refreshes.So the output provides all the necessary info, but I’m not sure how to get a row to tell me “% Utililized”This would be the total count of the ports in use (last column) divided into the the number of ports that specific switch, that show “0” across the board, and I’ll just take 1 zero and assume the rest are zeros (sometimes they are not, but this is just an estimate anyway). Any ideas are greatly appreicated./*** @intent Branch Counters* @description Branch Counters Interface Status show int counters on Arista & IOS-XE Switches * 1. Check to see what switch ports have had no traffic accross the wir
Apologies - This isn’t a question, and I can’t change it to a conversation -With recent changes in our NAC servers, we needed to check that our ‘ip helper-addresses’ were consistent to our regional standards. This is something we usually did with Python, but here’s a simple script to grab the helpers on each of the interfaces. I got the script working, but had some formatting issues, and thankfully a colleague was able to use some logic to format (@danny,Ramirez) via this statement:let ips = (foreach ip in ServerIP where match.data.IntName == ip.data.IntName select distinct toString(ip.data.helper))Ideally, we would would define the NAC servers per region, and export them as a check, but I haven’t gotten there yet ;-)pattern = ```interface {IntName:string} ip helper-address {helper:ipv4Address}```;foreach device in network.devices// Feel free to trim the scope with a where// where "Branch" in device.tagNames && "Core" in device.tagNames && "C9500" in device.tagNames
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.