sourceConfigText
sourceConfigText(value: T) : String for any type T.
Returns a String containing the lines of configuration linked from the given value.
If the value does not link to any lines of configuration, then the returned value is an empty String.
Values in NQE sometimes link to lines of configuration to show their source location. This function provides access to such relevant configuration so it can be included in a results export or in an API response to a query execution request.
Here is an example to illustrate the use of sourceConfigText.
The name field of an AclEntry typically links to the lines of configuration that define the ACL,
so the query
foreach device in network.devices
foreach aclEntry in device.aclEntries
select {
Device: device.name,
ACL: aclEntry.name,
Config: sourceConfigText(aclEntry.name)
}
is a good use of sourceConfigText.
Specifically, sourceConfigText(aclEntry.name) could return the String
<my-device-name,configuration.txt>
access-list MyAcl extended permit tcp host 10.169.24.197 host 10.230.109.245 eq www