You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/sivabala-opsql-opsramps-kalpavriksha-wish-fulfilling-tree.md
+26-62Lines changed: 26 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,34 +15,16 @@ li {
15
15
line-height: 20px;
16
16
max-width: none;
17
17
}
18
-
</style>
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
In today's data centers, IT Ops managers face mounting challenges in managing and retrieving data efficiently. They've introduced so many network, storage, and computing devices into their environment that they have become unmanageable. At times performance issues and critical services going down keep happening and they're left with headaches, higher costs, and poor performance. If only they had a Kalpavriksha, a magical wish-fulfilling tree that could answer their needs for quickly searching for any resource from their complex, wide data centre to make all their dreams come true.
28
-
29
-
With OpsRamp, a comprehensive IT operations management platform, they may very well get their wish. With its OpsRamp Query Language (OpsQL) and its powerful API, users can perform complex searches within the OpsRamp platform. It allows users to retrieve specific data based on various attributes and conditions. To quickly access and manipulate data in order to maintain optimal system performance and resolve issues, OpsQL is a Kalpavriksha that truly grants wishes. In this blog post, I will explain the basics of OpsQL and how to use it.
30
-
31
-
18
+
</style>
32
19
20
+
In today's data centers, IT Ops managers face mounting challenges in managing and retrieving data efficiently. They've introduced so many network, storage, and computing devices into their environment that they have become unmanageable. At times performance issues and critical services going down keep happening and they're left with headaches, higher costs, and poor performance. If only they had a Kalpavriksha, a magical wish-fulfilling tree that could answer their needs for quickly searching for any resource from their complex, wide data centre to make all their dreams come true.
33
21
22
+
With OpsRamp, a comprehensive IT operations management platform, they may very well get their wish. With its OpsRamp Query Language (OpsQL) and its powerful API, users can perform complex searches within the OpsRamp platform. It allows users to retrieve specific data based on various attributes and conditions. To quickly access and manipulate data in order to maintain optimal system performance and resolve issues, OpsQL is a Kalpavriksha that truly grants wishes. In this blog post, I will explain the basics of OpsQL and how to use it.
34
23
35
24
## What is OpsQL?
36
-
37
-
OpsQL is a flexible and powerful query language to search objects within the OpsRamp platform. It allows users to retrieve specific data based on various attributes and conditions. OpsQL is essential for IT administrators to quickly access and manipulate data, in order to maintain optimal system performance and resolve issues. IT Ops Managers, users can run OpsQL in intuitive OpsRamp UI or using OpsQL API.
38
-
39
-
40
-
41
-
42
-
25
+
OpsQL is a flexible and powerful query language to search objects within the OpsRamp platform. It allows users to retrieve specific data based on various attributes and conditions. OpsQL is essential for IT administrators to quickly access and manipulate data, in order to maintain optimal system performance and resolve issues. IT Ops Managers, users can run OpsQL in intuitive OpsRamp UI or using OpsQL API.
43
26
44
27
## Basic syntax and structure
45
-
46
28
Let's say you want to make a query. The general syntax for an OpsQL query is very straightforward:
47
29
48
30
```PlainText
@@ -51,7 +33,7 @@ Let's say you want to make a query. The general syntax for an OpsQL query is ver
51
33
52
34
You can use logical operators `AND` and `OR` to refine your search further.
53
35
54
-
## Operators
36
+
## Operators
55
37
Operator is the key of the query. It relates the attribute to the value.
56
38
OpsQL supports a variety of operators to create precise queries.
57
39
1.**Equality operators**
@@ -70,88 +52,70 @@ agentInstalled = "true" AND type = "Windows"
70
52
## Attributes
71
53
Attributes are different types of information available on an object. For instance, a resource might have attributes like `make`, `ipAddress`, and `agentInstalled`, while an alert might have attributes like `priority`, `currentState`, and `createdTime`.
72
54
55
+
For more details, you can refer to the [OpsRamp Query Language Reference Documentation.](https://docs.opsramp.com/platform-features/feature-guides/query-language-reference/query-language-ref/)
73
56
57
+
## More examples
58
+
Here are some OpsQL examples to search resources on the OpsRamp platform.
74
59
75
-
For more details, you can refer to the [OpsRamp Query Language Reference Documentation.](https://docs.opsramp.com/platform-features/feature-guides/query-language-reference/query-language-ref/)
76
-
77
-
78
-
79
-
## More examples
80
-
Here are some OpsQL examples to search resources on the OpsRamp platform.
81
-
82
-
### Search for resources that were discovered by an AWS Integration
83
-
60
+
### Search for resources that were discovered by an AWS integration
84
61
```PlainText
85
62
installedAppName = aws
86
63
```
87
-
88
64
### Search for resources that I tagged in AWS with AWS tag OwnerName :SivaBalaSubramanian
89
65
```PlainText
90
66
installedAppName = "aws" AND tags.name = "OwnerName" and tags.value = "SivaBalaSubramanian"
91
67
```
92
68
### Search for resources with alerts that have been open for the last 2 hours
93
-
94
69
```PlainText
95
70
createdTime > "-7200sec"
96
71
createdTime > "-120min"
97
72
```
98
-
99
-
### Search for Open alerts that are Critical
73
+
### Search for open alerts that are critical
100
74
```PlainText
101
75
currentState = "CRITICAL" AND status = "OPEN"
102
76
```
103
-
104
-
### Search for Open and Critical alerts that have an Open incident
77
+
### Search for open and critical alerts that have an open incident
105
78
```PlainText
106
79
currentState = "CRITICAL" AND status = "OPEN" AND incidentId IS NOT NULL
107
80
```
108
-
109
81
### Search for alerts that have been Open for longer than 2 hours
110
82
```PlainText
111
83
createdTime < "-7200sec"
112
84
```
113
-
114
-
### Search for Open and Critical alerts on resources tagged with AWS tag “BU: bu-123”
85
+
### Search for Open and critical alerts on resources tagged with AWS tag “BU: bu-123”
115
86
```PlainText
116
87
currentState = "CRITICAL" AND status = "OPEN" AND resource.tags.name = "Team" AND resource.tags.value = "Opsqa"
117
88
```
118
89
119
90
## What is OpsQL API?
120
-
The OpsQL API is a powerful interface that allows users to execute OpsQL queries programmatically. This API provides the flexibility to filter, search data within the OpsRamp platform, making it an indispensable tool for IT administrators and developers.
121
-
IT Administrators can invoke OpsQL API using tools such as Postman, cURL, Python.
122
-
91
+
The OpsQL API is a powerful interface that allows users to execute OpsQL queries programmatically. This API provides the flexibility to filter, search data within the OpsRamp platform, making it an indispensable tool for IT administrators and developers.
92
+
IT Administrators can invoke OpsQL API using tools such as Postman, cURL, Python.
93
+
123
94
124
95
125
96
#### Key features
126
-
127
-
1.**Comprehensive querying**: The OpsQL API supports a wide range of query operations, allowing users to filter data based on various attributes and conditions.
128
-
2.**Flexibility**: Users can create complex queries using logical operators and a variety of comparison operators.
97
+
1.**Comprehensive querying**: The OpsQL API supports a wide range of query operations, allowing users to filter data based on various attributes and conditions.
98
+
2.**Flexibility**: Users can create complex queries using logical operators and a variety of comparison operators.
129
99
3.**Integration**: The API can be integrated into custom applications, scripts, and workflows, enhancing automation and efficiency.
130
100
131
101
132
102
#### Basic syntax and structure
133
-
134
103
The general structure of an OpsQL API request involves specifying the tenant ID and the query payload.
135
104
136
-
137
-
138
-
139
105
Here’s a basic example:
140
106
141
107
```
142
108
POST /opsql/api/v3/tenants/{tenantId}/queries
143
109
```
144
110
145
111
The request body typically includes:
146
-
147
-
**`objectType`: The type of object to query (e.g., resource, alert, ticket).
148
-
**`fields`: The fields to retrieve.
149
-
**`filterCriteria`: The criteria to filter the objects.
112
+
*`objectType`: The type of object to query (e.g., resource, alert, ticket).
113
+
*`fields`: The fields to retrieve.
114
+
*`filterCriteria`: The criteria to filter the objects.
150
115
151
116
## Common use cases and code samples
152
-
153
-
### Filtering critical alerts
154
-
There are times that you would want to filter only critical alerts. This is how that would be done:
117
+
### Filtering critical alerts
118
+
There are times that you would want to filter only critical alerts. This is how that would be done:
The OpsQL API is a powerful tool that enhances the capabilities of the OpsRamp platform, providing users with the flexibility to perform complex queries and manage data efficiently. By leveraging the OpsQL API, IT administrators and developers can streamline their operations, improve data management, and enhance overall productivity. Thus OpsQL grants the wishes of IT Ops Managers with a single pane of glass and unified searching capability across their wide, complex real estate.
185
+
The OpsQL API is a powerful tool that enhances the capabilities of the OpsRamp platform, providing users with the flexibility to perform complex queries and manage data efficiently. By leveraging the OpsQL API, IT administrators and developers can streamline their operations, improve data management, and enhance overall productivity. Thus OpsQL grants the wishes of IT Ops Managers with a single pane of glass and unified searching capability across their wide, complex real estate.
222
186
For more details, you can refer to the [OpsQL API Documentation](https://develop.opsramp.com/v3/api/opsql/tenantid-queries/)
0 commit comments