Skip to content

Commit c69d8fb

Browse files
authored
docs: add logs queries (#1150)
1 parent 6c2cab8 commit c69d8fb

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

docs/troubleshooting/configuring-logs.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,85 @@ Example command to retrieve logs from `splunk-connect-for-snmp-worker-poller`:
7474
docker logs docker_compose-worker-poller-1
7575
```
7676

77+
## Useful Splunk Queries for Troubleshooting
78+
79+
If you are sending logs from Docker or Kubernetes to Splunk, the best solution to monitor the behavior of the SC4SNMP is
80+
to download the [dashboard](../dashboard.md#sc4snmp-monitoring-dashboard). Otherwise, you can use some of the Splunk queries mentioned below to check the
81+
statuses of specific tasks.
82+
83+
!!!info
84+
In all queries, replace `index=*` with the specific index, set in the OTEL or Docker configuration, to which the logs were sent in Splunk. Sourcetype name may differ based on SC4SNMP deployment.
85+
86+
### Walk status
87+
88+
To check the status of a walk task, you can use the following queries:
89+
90+
If the task was initialized by the scheduler after setting the `walk_interval`, use this query:
91+
```
92+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;walk"
93+
```
94+
95+
The status of a completed task can be `retry`, `succeeded`, or, in the case of an error, a message may include
96+
`raised unexpected`.
97+
If you encounter `retry` or `raised unexpected`, refer to the [troubleshooting polling section](polling-issues.md) of the documentation.
98+
The following queries can help filter logs to observe the walk task status:
99+
```
100+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.snmp.tasks.walk NOT received
101+
102+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.walk[*] retry"
103+
104+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.walk[*] succeeded"
105+
106+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.walk[*] raised unexpected"
107+
```
108+
You can also add the `IP address` to any of the above queries to filter results for a specific device.
109+
Example response for the `retry` query:
110+
```
111+
Task splunk_connect_for_snmp.snmp.tasks.walk[f77c6734-ed37-4759-9938-9345799dea57] retry: Retry in 28s: SnmpActionError('An error of SNMP isWalk=True for a host 127.0.0.1 occurred: No SNMP response received before timeout')
112+
```
113+
To check the status and progress of a specific task, filter by the task ID within the `[]`.
114+
115+
### Polling status
116+
117+
To check the status of a polling task, use the following queries:
118+
119+
If the task was initialized by the scheduler after setting the `frequency`, use this query:
120+
```
121+
index=* sourcetype="*:container:splunk-connect-for-snmp-scheduler*" "Scheduler: Sending due task sc4snmp;*;*;poll"
122+
```
123+
124+
The status of a completed task can be either `failed`, `succedded`.
125+
If the task shows `failed` refer to the [troubleshooting polling section](polling-issues.md) of the documentation.
126+
The following queries can help filter logs to observe the poll task status:
127+
```
128+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.poll[*] failed" "'address': '*'"
129+
130+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.poll[*] succeeded" "'address': '*'"
131+
```
132+
133+
You can replace `'address': '*'` with the `IP address` of the specific device.
134+
To check the status and progress of a specific task, filter by the `task ID`, which replaces `[*]`.
135+
136+
### Trap status
137+
138+
To check the status of a trap task, use the following queries:
139+
140+
The status of a completed task can be either `failed` or `succeeded`.
141+
If the task shows `failed`, refer to the [troubleshooting traps section](traps-issues.md) of the documentation.
142+
The following queries can help filter logs to observe the trap task status:
143+
```
144+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.trap[*] succeeded"
145+
146+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" "splunk_connect_for_snmp.snmp.tasks.trap[*] failed"
147+
```
148+
149+
### Splunk task status
150+
151+
To check if data is being sent properly to Splunk, use the following queries to observe whether they `succeeded` or `failed`:
152+
```
153+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.splunk.tasks.send
154+
155+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.enrich.tasks.enrich
156+
157+
index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.splunk.tasks.prepare
158+
```

0 commit comments

Comments
 (0)