This documentation is for Insight for Server/Data Center only.

The Insight Query Language is something that you can use in different places in Insight. The IQL will also be improved more and more and used in more places within Insight. Below, we will explain how to use it and give you some examples.

Syntax

<attribute> <operator> <value/function>
<attribute>.<attribute> <operator> <value/function>

Expression containing space has quote surrounded like "Mathias Edblom"

The attribute in the IQL is case sensitive!

Attributes

Placeholders

AttributeDescription
objectTypeYou can limit the search result to a specific object type, e.g. objecttype = Servers
objectTypeIdYou can limit the search result on object typ ids like objectTypeId in (1, 2) 
anyAttributeYou can search on any attribute like: "anyAttribute = 123.123.123.123"
objectLimit the search to the object, e.g. "object having inboundReferences()"


Operators

NameOperatorDescription
EQUAL=The value is equal (not case sensitive) to input
LESS_THEN<The value is less then input
MORE_THEN>The value is more then input
LESS_THEN_AND_EQUAL<=The value is less or equal then value
MORE_THEN_AND_EQUAL>=The value is more or equal then value
LIKElikeThe input is a subset of value
NOT_LIKEnot likeThe input does not contain the value
INinThe input is a set of values
NOT_EQUAL!=The value is not equal to input
NOT_INnot inThe input is not a set of values
STARTS_WITHstartswithThe input starts with input
ENDS_WITHendswithThe input ends with input
ISisThe input is something or not.

It followed by "empty" or "not empty". It represents if a value is existing or not.

OUTBOUND_REFERENCE.The attributes reference attribute is queried
STRICT_EQUAL==The value is strict (case sensitive) equal to input
HAVINGhavingThe input is having a property like inbound references
NOT HAVINGnot havingThe input is not having a property like outbound references

Combination

You may use AND to combine IQL expressions. OR is not supported as of today.

Functions 

Functions are used as the value in the above IQL syntax. They supply a dynamic values. 

Date:

  • now()
  • startOfDay()
  • endOfDay()
  • startOfWeek()
  • endOfWeek()
  • startOfMonth()
  • endOfMonth()
  • startOfYear()
  • endOfYear()

We use m for minutes, h for hours, d for days and w for weeks to represent relative time, e.g. Created > "-2h 15m" gives you all objects created in the last 2 hours and 15 minutes. You may do queries as iqlFunction([offset]) so an example could be startOfDay(-3w). 

You can also check for an upcoming date, as an example now(100d), which could be used to see if an license expires within an certain amount of time.

 

User:
  • currentUser() - Filter on any object connected to the current (logged in) user.
  • currentReporter() - Filter on any object connected to current reporter in custom fields

Group:

  • jiraGroup() - Filter on any object connected to a user within a specific JIRA group. E.g 'User IN jiraGroup("jira-users", "jira-administrators")'

Project:

  • currentProject() - Filter on any object connected to the current project in a custom field. 

References:

The reference functions takes an IQL as an argument. The argument can be an arbitrary IQL including an IQL with reference function. 

  • inboundReferences(IQL) - Filter object having inbound references where the objects referencing to the object matches the IQL. E.g. object having inboundReferences() will filter all objects having inbound references since the empty IQL will match all objects. If the query is changed to object having inboundReferences(Name="My Name") all objects that is referenced by an object with the name My Name will be filtered.
  • outboundReferences(IQL) - Filter object having outbound references where the referenced objects match the IQL. E.g. object having outboundReferences() will filter all objects having outbound references since the empty IQL will match all objects.

ObjectTypes:

  • objectTypeAndChildren(Name/id) from 4.7.1 - Filter all objects based on the object type specified by the name (or id) and it's children. E.g. objectType in objectTypeAndChildren("Object type name")

Example

Owner = "Mathias Edblom"
Status IN ("Running", "Open") AND Group = "jira-developers"
"License Date" > "-30d"
objectType = "Computer System" AND Status = Running
objectTypeId in (1, 2, 3)
Name like "Micro"
"Operating System" = "Linux"
"System Date" < "1/Nov/18"
Created = "1/Nov/18"
Manager IS NOT EMPTY
"License Date" IS EMPTY
"System Owner" IN ("Mathias Edblom", "Tommy Nordahl")
"User Group" != jira-developers
anyAttribute = 123.123.123.123
"System Owner"."JIRA User" = currentReporter()
"System Owner".anyAttribute = 23
Host.Virtual = true
object HAVING inboundReferences("IP address" is empty)
object NOT HAVING outboundReferences()
object HAVING inboundReferences(object HAVING outboundReferences(Name = "Linux"))
"System Owner" IN jiraGroup("jira-users", "jira-administrators")

Objects containing quotes

When searching for objects containing quotes, they need to be escaped.

Let's say you have an Object name 15" Screen, to search for it escape " with \, like \"

Name= "15\" Screen"

Dot notation

Dot notation is used to traverse down a reference chain. 

To demonstrate. Given a structure with 2 object types 

Attribute

ObjectType: Employee Details
NameDefault string attribute
Using SoftwareReference to object type Software

Attribute

ObjectType: Software
NameDefault string attribute
Status

Status attribute

To query object of type Employee Details using a software with status attribute missing one would query

"Using Software".Status is empty


The following screenshots show the same example.






Read about where to use IQL

  Page: Insight Automation
  Page: Insight Custom Field
  Page: Insight Referenced Custom Field
  Page: Insight Searching & Filtering