Skip to content

Commit 6261cd8

Browse files
Update Blog “sivabala-opsql-opsramps-kalpavriksha-wish-fulfilling-tree”
1 parent 5a519e8 commit 6261cd8

File tree

1 file changed

+26
-62
lines changed

1 file changed

+26
-62
lines changed

content/blog/sivabala-opsql-opsramps-kalpavriksha-wish-fulfilling-tree.md

Lines changed: 26 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,16 @@ li {
1515
line-height: 20px;
1616
max-width: none;
1717
}
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>
3219

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.
3321

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.
3423

3524
## 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.
4326

4427
## Basic syntax and structure
45-
4628
Let's say you want to make a query. The general syntax for an OpsQL query is very straightforward:
4729

4830
```PlainText
@@ -51,7 +33,7 @@ Let's say you want to make a query. The general syntax for an OpsQL query is ver
5133

5234
You can use logical operators `AND` and `OR` to refine your search further.
5335

54-
## Operators
36+
## Operators
5537
Operator is the key of the query. It relates the attribute to the value.
5638
OpsQL supports a variety of operators to create precise queries.
5739
1. **Equality operators**
@@ -70,88 +52,70 @@ agentInstalled = "true" AND type = "Windows"
7052
## Attributes
7153
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`.
7254

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/)
7356

57+
## More examples
58+
Here are some OpsQL examples to search resources on the OpsRamp platform.
7459

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​
8461
```PlainText
8562
installedAppName = aws
8663
```
87-
8864
### Search for resources that I tagged in AWS with AWS tag OwnerName :SivaBalaSubramanian
8965
```PlainText
9066
installedAppName = "aws" AND tags.name = "OwnerName" and tags.value = "SivaBalaSubramanian"​
9167
```
9268
### Search for resources with alerts that have been open for the last 2 hours​
93-
9469
```PlainText
9570
createdTime > "-7200sec" ​
9671
createdTime > "-120min"​
9772
```
98-
99-
### Search for Open alerts that are Critical​
73+
### Search for open alerts that are critical​
10074
```PlainText
10175
currentState = "CRITICAL" AND status = "OPEN" ​
10276
```
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​
10578
```PlainText
10679
currentState = "CRITICAL" AND status = "OPEN" AND incidentId IS NOT NULL ​
10780
```
108-
10981
### Search for alerts that have been Open for longer than 2 hours​
11082
```PlainText
11183
createdTime < "-7200sec" ​
11284
```
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”​
11586
```PlainText
11687
currentState = "CRITICAL" AND status = "OPEN" AND resource.tags.name = "Team" AND resource.tags.value = "Opsqa"​
11788
```
11889

11990
## 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+
12394

12495

12596
#### 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.
12999
3. **Integration**: The API can be integrated into custom applications, scripts, and workflows, enhancing automation and efficiency.
130100

131101

132102
#### Basic syntax and structure
133-
134103
The general structure of an OpsQL API request involves specifying the tenant ID and the query payload.
135104

136-
137-
138-
139105
Here’s a basic example:
140106

141107
```
142108
POST /opsql/api/v3/tenants/{tenantId}/queries
143109
```
144110

145111
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.
150115

151116
## 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:
155119

156120

157121
```python
@@ -180,9 +144,9 @@ headers = {
180144

181145
response = requests.request("POST", url, headers = headers, data = payload)
182146
```
183-
### Saving OpsQL response as CSV file
184-
There are times that you would want to save an OpsQL response as a CSV file, perhaps for further analysis. This is how that would be done:
185-
147+
### Saving OpsQL response as CSV file
148+
There are times that you would want to save an OpsQL response as a CSV file, perhaps for further analysis. This is how that would be done:
149+
186150

187151

188152
```python
@@ -218,5 +182,5 @@ def json_to_csv(resources_json, file_csv) -> None :
218182

219183
```
220184
## Conclusion
221-
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.
222186
For more details, you can refer to the [OpsQL API Documentation](https://develop.opsramp.com/v3/api/opsql/tenantid-queries/)

0 commit comments

Comments
 (0)