webkeeper-logs
Fetch web proxy 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 | |
| user | String | User | |
| emp_name | String | Employee name | |
| dept_name | String | Department name | |
| src_ip | IP | Source IP | |
| dst_ip | IP | Destination IP | |
| dst_port | Integer | Destination port | |
| policy | String | Policy | |
| category_code | Integer | Category code | e.g. 900010000000512 |
| category | String | Category name | e.g. Internet (general) |
| method | String | HTTP Method | GET, POST |
| domain | String | Domain | e.g. example.com |
| path | String | Path | |
| query | String | Query string | |
| referer | String | HTTP referer | |
| file_num | Integer | File count | |
| keyword | String | Keyword | |
| post_size | Integer | HTTP post size | |
| pass_block_type | Integer | Block type | 0: PERMIT, 256: CATEGORY_BLOCK, 512: SIZE_BLOCK |
| post_size_limit | Integer | POST size limit | |
| dept_code | String | Department 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 web (http) logs. Log types are distinguished by documents which have the receive time field (http_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.
category is the web category name of category_code. path and query are split from the original URI by ?.
Examples
Example: Top blocked web domains
Situation: Find domains with many web accesses blocked by category policy in the last day.
webkeeper-logs profile=webkeeper duration=1d
| search pass_block_type == 256
| stats count by domain, category
| sort -count
| limit 10
Expected result:
| domain | category | count |
|---|---|---|
| example.com | Game | 120 |
| www.example.com | Gambling | 35 |
Interpretation: Check whether the policy works as intended for the blocked domains and categories, and whether specific users access them repeatedly.