How to View Thing Events Logs?
This guide will show you how you can see Thing Event logs via API.
To view Thing Events logs, please use following request:
1
curl -X POST "https://console.monogoto.io/thing/searchCDR" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer <<<_TOKEN_HERE_>>>" -d "{ \"ThingIdELK\": \"<<<_THING_ICCID_ID_>>>\", \"SeverityELK\": \"<<<_EVENT_SEVERITY_>>>\", \"gteTimestampELK\": \"<<<_GREATER_OR_EQUAL_TIMESTAMP_>>>\", \"ltTimestampELK\": \"<<<_LESS_TIMESTAMP_>>>\", \"EsDataTypeELK\": \"<<<_EVENT_DATA_TYPE_>>>\", \"MessageTypeELK\": \"s<<<_EVENT_MESSAGE_TYPE_>>>\", \"limit\": \"<<<_RESULTS_LIMIT_>>>\"}"
Copied!
Please note that the above shown command needs to be replaced with information: <<<_TOKEN_HERE_>>> - replace with your token. You may obtain Token, by running Login Token API command. <<<_THING_ICCID_ID_>>> - replace with ThingId_ICCID_ABC, where ABC is your thing ICCID. Example: ThingId_ICCID_8912372646888991 <<<_EVENT_SEVERITY_>>> - replace with the severity of the Event you wish to be displayed. <<<_GREATER_OR_EQUAL_TIMESTAMP_>>> - replace with the timestamp of date/time to show greater or equal date/time Events. Please enter date/time in epoch format with milliseconds. You may use a converter that can be found following this link. <<<_LESS_TIMESTAMP_>>> - replace with the timestamp of date/time to show less than entered date/time Events. Please enter date/time in epoch format with milliseconds. You may use a converter that can be found following this link. <<<_EVEN_MESSAGE_TYPE_>>> - replace with the Event message type to be displayed. <<<_RESULTS_LIMIT_>>> - replace with how many results you want to be displayed. Default when not using this line is 10 results. If needed this API can be tested and used in the Monogoto portal following this path: Thing POST /thing/searchCDR
Please note that only API command lines <<<_TOKEN_HERE_>>> and <<<_THING_ICCID_ID_>>> are mandatory, others can be removed from API command if not needed
Example of request that will show last 50 Events for our Thing:
1
curl -X POST "https://console.monogoto.io/thing/searchCDR" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJhb6IkpXVCJ9.eyJSb2xlIjoiVXN4lclByb2ZpbGVJZF9kZGM2MThhNC0wNTI1LTQ2MmUtYWN3NzhhMGQxYmbSI6Im4zgFkbWluIiwiQ3VzdG9tsbCwiVXNlcklkIjoiVklkXzg5Yj5Y2OGEyUtNDQThhLTEzZjA0MzJhZDE3YyINTAzgZmUtZGI51My00ZjRiLTktN2U5Yjc0ZWU1ZThlIiwiaWNzM3MjI5L2MDY3NTE2Mjl9.99aSLzP7kTgK6TZGW-xalrMu0GkW6viunt3XxbNng" -d "{ \"ThingIdELK\": \"ThingId_ICCID_8912372646888991\", \"limit\": \"50\"}"
Copied!
Expected result will show 50 last Events for our Thing:
1
{
2
"totalResults": 151,
3
"hits": [
4
{
5
"_source": {
6
"EsDataType": "GGSN_AUTHENTICATE_PDP_CONTENT_RESULT",
7
"Severity": "Info",
8
"message": "Success authenticate_pdp_context for Thing ICCID 8912372646888991 MNO= UAB TELE2. Session ID =8993090, Allowed Bytes= 20971520",
9
"Timestamp": 1609154365332,
10
"MessageType": "EVENT"
11
}
12
},
13
{
14
"_source": {
15
"EsDataType": "GGSN_AUTHENTICATE_PDP_CONTENT",
16
"Severity": "Info",
17
"message": "authenticate_pdp_context v2 for Thing=ICCID 8912372646888991 from SGSN 10.99.5.34 RAI=null . Allowed Bytes = 20971520",
18
"Timestamp": 1609154365331,
19
"MessageType": "EVENT"
20
}
21
},
22
{
23
"_source": {
24
"EsDataType": "GGSN_DELETE_PDP_CONTENT",
25
"Severity": "Info",
26
"message": "delete_pdp_context for Thing=ICCID 8912372646888991, Session ID=8986961, Used bytes=18464019",
27
"Timestamp": 1609154364198,
28
"MessageType": "EVENT"
29
}
30
31
32
...
Copied!
Example of request that will show only Event CDR results for our Thing:
1
curl -X POST "https://console.monogoto.io/thing/searchCDR" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJhb6IkpXVCJ9.eyJSb2xlIjoiVXN4lclByb2ZpbGVJZF9kZGM2MThhNC0wNTI1LTQ2MmUtYWN3NzhhMGQxYmbSI6Im4zgFkbWluIiwiQ3VzdG9tsbCwiVXNlcklkIjoiVklkXzg5Yj5Y2OGEyUtNDQThhLTEzZjA0MzJhZDE3YyINTAzgZmUtZGI51My00ZjRiLTktN2U5Yjc0ZWU1ZThlIiwiaWNzM3MjI5L2MDY3NTE2Mjl9.99aSLzP7kTgK6TZGW-xalrMu0GkW6viunt3XxbNng" -d "{ \"ThingIdELK\": \"ThingId_ICCID_8997211240710951969\", \"MessageTypeELK\": \"CDR\",}"
Copied!
Expected result will show only CDR Events for our Thing:
1
{
2
"totalResults": 31,
3
"hits": [
4
{
5
"_source": {
6
"EsDataType": "DATA",
7
"Severity": "Info",
8
"message": "ICCID 8997211240710951969 used 1440448 bytes ",
9
"Timestamp": 1612339903864,
10
"MessageType": "CDR"
11
}
12
},
13
{
14
"_source": {
15
"EsDataType": "DATA",
16
"Severity": "Info",
17
"message": "ICCID 8997211240710951969 used 1222281 bytes ",
18
"Timestamp": 1612339856758,
19
"MessageType": "CDR"
20
}
21
},
22
{
23
"_source": {
24
"EsDataType": "MT_SMS",
25
"Severity": "Info",
26
"message": "Success. txId=ThingId_ICCID_8997211240710951969_1612339830744_0.5133170465420831 SMS txId=ThingId_ICCID_8997211240710951969_1612339830744_0.5133170465420831 from console to ICCID 8997211240710951969",
27
"Timestamp": 1612339831262,
28
"MessageType": "CDR"
29
}
30
},
31
32
...
Copied!
Last modified 2mo ago
Copy link