webkeeper-netapps-logs
Fetch NetApp logs from Elastic of WebKeeper SG.
Syntax
Options
- profile=PROFILE
- Optional. The identifier of WebKeeper SG connect profile. If omitted, all WebKeeper SG connect profiles are queried.
- duration=NUM{mon|w|d|h|m|s}
- Optional. Scan only recent data. You should use s(second), m(minute), h(hour), d(day), mon(month) time unit. For example,
10smeans data from 10 seconds earlier. - from=yyyyMMddHHmmss
- Optional. Start time of range. yyyyMMddHHmmss format. If you omit time part, it will be padded by zero.
- to=yyyyMMddHHmmss
- Optional. End time of range. yyyyMMddHHmmss format. If you omit time part, it will be padded by zero.
- offset=NUM
- Optional. Skip count
- limit=NUM
- Optional. Max output count
Output fields
| Field | Type | Name | Description |
|---|---|---|---|
| _time | Date | Time | |
| guid | String | Log GUID | |
| agent_id | String | Agent ID | |
| policy | String | Policy | |
| action | String | Action | PERMIT, DENY |
| user | String | User | |
| emp_name | String | Employee name | |
| dept_name | String | Department name | |
| dept_id | String | Department ID | |
| dept_code | String | Department code | |
| src_ip | IP | Source IP | |
| dst_ip | IP | Destination IP | |
| dst_port | Integer | Destination port | |
| category_code | Integer | Category code | NetApp category code |
| service_code | Integer | Service code | NetApp service code |
| user_guid | String | User GUID |
Error codes
Parsing errors
| Error message | Cause | Solution |
|---|---|---|
| invalid-webkeeper-profile | The connect profile in the profile option does not exist | Check the identifier of the WebKeeper SG connect profile in System > Connect Profiles |
| no-permission | The profile option is omitted and there is no WebKeeper SG connect profile you can access | Add a WebKeeper SG connect profile or check its permission |
Runtime errors
| Error message | Cause | Solution |
|---|---|---|
| webkeeper error, profile=PROFILE - cause | Cannot connect to the Elastic server or the response is invalid | Check the Elastic URL of the connect profile and the firewall policy from Sonar to the Elastic web port |
Description
The Elastic indices of WebKeeper SG (starting with wk_) store web logs and NetApp logs together. This command fetches only NetApp (netapps) logs. Log types are distinguished by documents which have the receive time field (apps_rcvtime).
If duration, from, or to is specified, indices are selected by the index format of the connect profile, and the range is limited by the receive time. Without a period, all indices are scanned, so specify a period when there is a lot of data. Results are not sorted by time.
offset and limit apply to the whole result across connect profiles and indices.
Elastic provides NetApp categories and services only as numeric codes, so they are output as is in category_code and service_code. The allow/block value (apps_isblock) is normalized to action: 3 is PERMIT, 2 is DENY.
Examples
Example: NetApp blocks
Situation: Check blocked NetApp accesses by user in the last hour.
webkeeper-netapps-logs profile=webkeeper duration=1h
| search action == "DENY"
| stats count by user, dst_ip
| sort -count
Expected result:
| user | dst_ip | count |
|---|---|---|
| test_user | 192.0.2.3 | 15 |
| user1 | 192.0.2.4 | 4 |
Interpretation: Check users and destinations with repeated blocks to decide whether a policy exception is needed for a business service or it is an attempt to bypass the policy.