Live Output Data¶
The output data is in the form of Predictions, Confidence Score, and Explanation Score. These are organized as Falkonry generated signals. Each type of the Falkonry generated signals has its own identity and an endpoint to get the data.
Signal Data API </apis/raw_points> can be used to retrieve the data for each of the Falkonry generated signalsusing an unique identity referred as Signal ID. To get the relevant ID use the following Live Context API.
Query Parameters¶
?modelType=:Set asCONDITIONto get live models of Falkonry Patterns and set asANOMALYto get live models of Falkonry Insights.?model=: Filter the Live Contexts by model. Set this toModel IDretrieved from theJobs API </apis/fetch_model>.?assessment=: Filter the Live Contexts by assessment. Set this toAssessment ID.?isCommonModel=: Get list of Live Contexts each corresponding to a Live Common Model (i.e. M[0]) and a live entity. Set this totrue.?offset=: Index to start for the next paginated request. Default value is0.?limit=: Number of items to include in each page result. There could be fewer items remaining than the specified value.?sort=: Sort the items by time. Set this to-createTimeto get latest item first.
cURL request¶
$ curl -H "Authorization: Bearer <token>" \
"<https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/livecontexts?isCommonModel=true&modelType=CONDITION&offset=0&limit=1000>"
Python¶
import requests
URL =c'https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/livecontexts?isCommonModel=true&modelType=CONDITION&offset=0&limit=1000'
TOKEN = '<token>'
HEADERS = {'Authorization': f'Bearer {TOKEN}'}
response = requests.get(URL, headers=HEADERS)
print(response.json())
Example response
[
{
"id": "938027869534007296",
"tenant": "xxxxxxxxxxxxxxx",
"model": "mmmmmmmmmmmmmmm",
"entity": "eeeeeeeeeeee",
"type": "entities.livecontext",
"modelType": "CONDITION",
"contextIds": [],
"inputContexts": [],
"evalStartTime": "2023-07-30T13:57:46.260000Z",
"outputContexts": [
{
"context": "919892128240259072.919887302722867200",
"type": "Numeric",
"signal": "919892128240259072",
"signalKey": "explanations-orz7kd747m",
"signalName": "Explanation-sensor2"
},
{
"context": "919892128361893888.919887302722867200",
"type": "Numeric",
"signal": "919892128361893888",
"signalKey": "explanations-onz6216rgo",
"signalName": "Explanation-sensor3"
},
{
"context": "919892128395448320.919887302722867200",
"type": "Numeric",
"signal": "919892128395448320",
"signalKey": "explanations-qwl3573r9m",
"signalName": "Explanation-sensor1"
},
{
"context": "919892128768741376.919887302722867200",
"type": "Categorical",
"signal": "919892128768741376",
"signalKey": "predictions",
"signalName": "Predictions"
},
{
"context": "919892128873598976.919887302722867200",
"type": "Numeric",
"signal": "919892128873598976",
"signalKey": "confidences",
"signalName": "Confidences"
},
{
"context": "919892129074925568.919887302722867200",
"type": "Events",
"signal": "919892129074925568",
"signalKey": "episodes",
"signalName": "Episodes"
}
],
"datastream": "yyyyyyyyyyyy",
"assessment": "zzzzzzzzzzzz",
"createTime": 1643713671812,
"updateTime": 1643713671812,
"isCommonModel": true,
"links": []
}
]
Note
The API response will have a unique Live Context object for each entity. Use the context id (also referred to as Signal ID) of corresponding Falkonry generated signal within the outputContexts JSON array to get the output data via Signal Data API </apis/raw_points>.
For example, use 919892128768741376.919887302722867200 as Signal ID to get Predictions data for entity eeeeeeeeeeee.
Check Live Monitoring Liveliness¶
Each entity that is live monitoring has a corresponding Live Context. To
know the liveliness of the live model for an entity, you can use the
evalStartTime property from the above Live Context API response.
This is the timestamp until which all the signal data for the entity is
considered for live monitoring and Falkonry generated signals must have
data until this timestamp. You can automate the monitoring liveliness
check by using the above API.
This timestamp will always be behind the fast moving signal to give tolerance to the slow moving signals to have the data ready for processing. In case this timestamp falls behind by couple of hours from the current time, you can initiate the investigation by first looking at the Connection summary or signal's latest data point time under All Signals section to know how recent Falkonry received the data.