Accessing the search logs of an asset¶
Search logs provide valuable insights for analysts to monitor the popularity of assets within Atlan, including details such as the most visited assets, user interactions, and emerging search patterns. Accessing the search log of an asset is a flexible operation, which may seem more intricate compared to other operations. To harness the complete flexibility of Atlan's search, the SDK introduces a dedicated SearchLogRequest
object.
Similar but not identical to searching in general
Atlan's search log, which contains the search logs of an asset, utilizes Elasticsearch. This makes the approach to accessing search logs similar to searching. However, there are differences, as the search log uses a distinct index from the broader search. If you're feeling adventurous, feel free to experiment with the more complex search mechanisms outlined in the searching section. Nevertheless, this should be sufficient to help you get started with accessing asset search logs.
Most recent viewers of an asset¶
To retrieve the most recent viewers of an asset:
Retrieve the most recent viewers of an asset | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- You must provide
GUID
of the asset and specify the maximum number of recent users to be considered for the search log request.- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each recent viewers.
- Name of the user who viewed the asset.
- Number of times the user viewed the asset.
- When the user most recently viewed the asset (epoch-style), in milliseconds.
Retrieve the most recent viewers of an asset | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
- You must provide a
GUID
and specify the maximum number of recent users to be considered for the search log request.- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each recent viewers.
- Name of the user who viewed the asset.
- Number of times the user viewed the asset.
- When the user most recently viewed the asset (epoch-style), in milliseconds.
Retrieve the most recent viewers of an asset | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- You must provide a
GUID
and specify the maximum number of recent users to be considered for the search log request.- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each recent viewers.
- Name of the user who viewed the asset.
- Number of times the user viewed the asset.
- When the user most recently viewed the asset (epoch-style), in milliseconds.
POST /api/meta/search/searchlog | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
GUID
of the asset for which you are seeking the details of recent viewers.- Maximum number of recent users to be considered for the search log request.
- Optionally, you may provide a list of usernames to be excluded from the search log results.
Most viewed assets¶
To retrieve the most viewed assets by its total views:
Retrieve the most viewed assets by its total views | |
---|---|
1 2 3 4 5 6 7 8 |
|
- To retrieve the most viewed assets, specify the maximum number of assets you want to retrieve.
Then specify whether you want the most-viewed based on total number of views, irrespective
of distinct users (
false
); or based on the most distinct users, irrespective of total views (true
).- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each asset's views.
GUID
of the asset that was viewed.- Number of times the asset has been viewed (in total).
- Number of distinct users that have viewed the asset.
Retrieve the most viewed assets by its total view | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
- To retrieve the most viewed assets, specify the maximum number of assets you want to retrieve.
Then specify whether you want the most-viewed based on total number of views, irrespective
of distinct users (
False
); or based on the most distinct users, irrespective of total views (True
).- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each asset's viewers.
- Name of the user who viewed the asset.
- Number of times the user viewed the asset.
- Number of distinct users that have viewed the asset.
Retrieve the most viewed assets by its total view | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- To retrieve the most viewed assets, specify the maximum number of assets you want to retrieve.
Then specify whether you want the most-viewed based on total number of views, irrespective
of distinct users (
false
); or based on the most distinct users, irrespective of total views (true
).- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each asset's viewers.
- Name of the user who viewed the asset.
- Number of times the user viewed the asset.
- Number of distinct users that have viewed the asset.
POST /api/meta/search/searchlog | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
- Maximum number of assets to be considered for the search log request
- If you want to retrieve most viewed assets based on the most distinct users,
regardless of total views, include
"order": [{"uniqueUsers": "desc"}]
here. - Optionally, you may provide a list of usernames to be excluded from the search log results.
Detailed search log entries¶
To retrieve detailed search log entries (paged via lazy fetching):
To retrieve detailed search log entries | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- You must provide the
GUID
of the asset for which you are seeking the detailed search log entries.- Optionally, you may provide a list of usernames to be excluded from the search log results.
- The search will only run when you call the
stream()
method, which will then lazily-load each page of results into a stream -
With streaming, you can apply your own limits to the maximum number of results you want to process.
Independent of page size
Note that this is independent of page size. You could page through results 50 at a time, but only process a maximum of 100 total results this way. Since the results are lazily-loaded when streaming, only the first two pages of results would be retrieved in such a scenario.
-
You can then iterate through each
log entry
to retrieve details such as the username and IP address of the search logs.
To retrieve detailed search log entries | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
- You must provide the
GUID
of the asset and specify the maximum number of log entries per page for the search log request.- Optionally, you may provide a list of usernames to be excluded from the search log results.
- You can then iterate through each
log entry
to retrieve details such as the username and IP address of the search logs.
To retrieve detailed search log entries | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- You must provide the
GUID
of the asset for which you are seeking the detailed search log entries.- Optionally, you may provide a list of usernames to be excluded from the search log results.
- The search will only run when you call the
stream()
method, which will then lazily-load each page of results into a stream -
With streaming, you can apply your own limits to the maximum number of results you want to process.
Independent of page size
Note that this is independent of page size. You could page through results 50 at a time, but only process a maximum of 100 total results this way. Since the results are lazily-loaded when streaming, only the first two pages of results would be retrieved in such a scenario.
-
You can then iterate through each log entry to retrieve details such as the username and IP address of the search logs.
POST /api/meta/search/searchlog | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
- Page size of the search log request.
GUID
of the asset for which you are seeking the detailed search log entries.- Optionally, you may provide a list of usernames to be excluded from the search log results.