# Logs

Once you are inside the Analyze tab, you are provided with the option of viewing several types of logs:

Query Log

Activity Log

Crash Log

You can also export query logs which can be use as a valuable source of data once your AI models are in production.

# Query Log

Query log provides your direct access to specific users’ queries and sessions. User queries are logged and scrubbed of any extra data before pass to query response payload, for example, log system specific data, business logic request and response data etc. They are stored inside log-stash and retrieved using OpenSearch.

Currently, the platform supports two data formats: JSON and CSV. They take the following format:

# JSON

{
    "_index": "logstash-finie-2019.12.02",
    "_type": "doc",
    "_id": "2c7304ab-6858-4393-8d43-f998c82a87c1",
    "_score": null,
    "_source": {
        "host": "3dca8f95906e",
        "tags": [
            "querylog"
        ],
        "@version": "1",
        "extra": {
            "interpreter_version": "3.6.8",
            "thread_name": "Dummy-1",
            "line": 246,
            "logger_name": "logstash_querylog",
            "interpreter": "/usr/local/bin/python3",
            "logstash_async_version": "1.4.1",
            "path": "/usr/local/lucida-clinc/uservices/logstash/client.py",
            "process_name": "MainProcess",
            "func_name": "store_query_response"
        },
        "pid": 601,
        "program": "mod_wsgi",
        "type": "python-logstash",
        "@timestamp": "2019-12-02T21:00:03.352Z",
        "logsource": "3dca8f95906e",

Log system specific data.

        "doc": {
            "TIMESTAMP": "2019-12-02T21:00:00.033Z",
            "INPUT": {
                "qid": "2c7304ab-6858-4393-8d43-f998c82a87c1",
                "lon": 0,
                "latency": 3.3747273557819426,
                "personality_id": "f2328332-ed27-4c4d-8470-8e568c252d5a",
                "device": "default",
                "time_offset": 0,
                "competency_id": "71a397fb-b5f1-4c8f-9db4-efcbd881170d",
                "classifier": "stateful-qsr_example-states-state",
                "platform": "web",
                "institution_id": "1d8a75fd-aa9f-46f6-b957-ff286fe5b24f",
                "classifier_state": "food_order",

Everything in doc list are query specific data. Please reference Query Response for what each field stands for.

                "bl_resp": {
                    "query": "I want a burger",
                    "qid": "2c7304ab-6858-4393-8d43-f998c82a87c1",
                    "slots": {
                        "_FOOD_MENU_": {
                            "values": [
                                {
                                    "value": "hamburger",
                                    "food_menu_dest": "hamburger",
                                    "tokens": "hamburger",
                                    "resolved": 1
                                }
                            ],
                            "type": "string"
                        }
                    },
                    "lon": 0,
                    "state": "food_order",
                    "intent_probability": 0.9498837367690086,
                    "session_id": "3329bf2f4223412d9dba08cc115ae449",
                    "device": "default",
                    "dialog": "qnBKoS2AjVPAyXalsYvAlto+VEOwt+bj",
                    "time_offset": 0,
                    "intent": "food_order_start",
                    "ai_version": "292fdc79-d01d-4db7-ae71-800584fbd118",
                    "sentiment": 0,
                    "lat": 0,
                    "external_user_id": "1"
                },

Reference The Response Body section on the Business Logic page for what each field stands for.

                "sentiment": 0,
                "lat": 0,
                "slot_probabilities": {
                    "_FOOD_MENU_": [
                        0.9999535083770752
                    ]
                },
                "response_slots": null,
                "slot_data": "{\"_FOOD_MENU_\": {\"type\": \"string\", \"values\": [{\"value\": \"hamburger\", \"resolved\": #, \"food_menu_dest\": \"hamburger\", \"tokens\": \"hamburger\"}]}, \"remaining_slots\": []}",
                "query": "I want a burger",
                "intent_raw": "food_order_start",
                "visual_payload": null,
                "intent_probability": 0.9498837367690086,
                "competency": "food_order",
                "bl_url": "https://business-logic-qsr.clinc.com",
                "today": "2019-12-02T21:00:00.033Z",
                "session_id": "3329bf2f4223412d9dba08cc115ae449",

Please reference Query Response for what each field stands for.

                "bl_req": {
                    "query": "I want a burger",
                    "qid": "2c7304ab-6858-4393-8d43-f998c82a87c1",
                    "slots": {
                        "_FOOD_MENU_": {
                            "type": "string",
                            "values": [
                                {
                                    "food_menu_dest": "hamburger",
                                    "tokens": "burger",
                                    "resolved": -1
                                }
                            ]
                        }
                    },
                    "lon": 0,
                    "state": "food_order",
                    "intent_probability": 0.9498837367690086,
                    "session_id": "3329bf2f4223412d9dba08cc115ae449",
                    "device": "default",
                    "dialog": "qnBKoS2AjVPAyXalsYvAlto+VEOwt+bj",
                    "time_offset": 0,
                    "intent": "food_order_start",
                    "ai_version": "292fdc79-d01d-4db7-ae71-800584fbd118",
                    "sentiment": 0,
                    "lat": 0,
                    "external_user_id": "1"
                },

Reference The Request Body section on the Business Logic page for what each field stands for.

                "is_repeat": false,
                "dialog": "ZPqY5/a8qRq2t9Fktd6h7hJ5pjBnFNY6",
                "latencies": {
                    "webhook_total": 0.786525,
                    "webhook_latency": {},
                    "total": 3.3747273557819426,
                    "external_api": null
                },
                "version": "release-v0.8.21",
                "intent": "food_order_start",
                "is_correction": false,
                "ai_version": "292fdc79-d01d-4db7-ae71-800584fbd118",
                "browser": "Other",
                "slot_token_ranges": {
                    "_FOOD_MENU_": [
                        {
                            "end": 3,
                            "start": 3
                        }
                    ]
                },
                "certainty": true,
                "user": "978fbedc-12f0-a2b4-8afd-5c740d46b3de",
                "external_user_id": "1"
            },
            "OUTPUT": {
                "speakableResponse": "Okay, so you would like hamburger. Is that all you'd like?",
                "formattedResponse": "Okay, so you would like hamburger. Is that all you'd like?",
            }
        },

Please reference Query Response for what each field stands for.

        "level": "INFO",
        "port": 43234
    },
    "sort": [
        1575320403352
    ]
},

Log system specific data.

# CSV

Query logs in CSV takes the following format:

query log in CSV

By default it provides these fields (not necessarily in this order):

  • qid
  • lon
  • latency
  • personality_id
  • device
  • time_offset
  • competency_id
  • classifier
  • platform
  • institution_id
  • classifier_state
  • sentiment
  • lat
  • slot_data
  • query
  • intent_raw
  • intent_probability
  • competency
  • today
  • session_id
  • is_repeat
  • dialog
  • extra_params
  • version
  • latencies
  • intent
  • is_correction
  • ai_version
  • browser
  • certainty
  • user
  • external_user_id
  • speakableResponse
  • formattedResponse
  • visual_data

Reference the Query Response page for explanations of each field.

# Filters

These queries can be filtered by different views including:

  • Date and time: Sort the queries by most recent, least recent, or choose a specific time frame.
  • Competencies: Choose to visualize only queries from a specific competency.
  • Platforms: Sort by platforms such as web or mobile.
  • Sentiment: Choose to show only positive or negative user queries.
  • Classification Probability: How confident the classifier was in its classification.
  • Keyword: Search queries for specific keywords.

# Export Logs

On the export logs page, you can choose the start and end date of the query logs that you wish to export as well as exporting the logs in either JSON format or CSV format.

export_logs

Reference the format in JSON and CSV in the Query Log section.

To export logs:

  1. Choose the start and end date then click APPLY.
  2. Choose the data format.
  3. Click the newly created block to download the query logs.


Last updated: 12/10/2019