I wanted to know if there is a way to pull Watson conversation logs for a specific time period using Watson Python SDK? Also is there a way to avoid the pagination added at the end of the logs? I want to pull all the logs for a given time period. Below is the code I am currently using which pulls logs for a specific workspace:
import json
import watson_developer_cloud
conversation = watson_developer_cloud.ConversationV1(
username='xxxxxxxxxx',
password- 'xxxxxxxx',
version='2017-05-26'
)
response = conversation.list_logs(
workspace_id = 'xxxxxxx'
)
js = json.dumps(response,indent=2)
with open('data.txt', 'w') as outfile:
json.dump(response, outfile)
As you can see on the Official documentation, you can use the
filter
parameter to list logs and have a lot of options to use.Filter:
filter/string
A cacheable parameter that limits the results to those matching the specified filter. For more information, see Filter query reference.So you need to replace with your
response_timestamp
: