# Checking Thing Connection via Event Logs

Another very reliable, but more difficult method of checking if SIM card is connected to a network is to check out Thing Event Logs.

There are 2 main ways to check out Thing Event logs:

### Checking Thing Events Logs via self-service console:

1\.       Login to the Monogoto porta&#x6C;***.***

2\.       Go to **Things** section of the porta&#x6C;***.***

![](/files/gU81bFIhA047BKMQG58Q)

3\.       Select a Thing from the list of seen Things in the porta&#x6C;***.***

![](/files/cdRUB9rNR98LqE2A8oau)

4\.       Use scroll bar, to scroll down to the end of the Thing Menu page.

![](/files/oW0cZ1Mpl7jH3rnFevhP)

5\.       Check Events section of the Thing Menu page.

![](/files/J1XEyrCAUMz4QEnbfB4e)

6\.       Search in Thing Menu newest events for one of the below provided examples:

| Event Message example                                                                                                                  | Description                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success authenticate\_pdp\_context for Thing ICCID 8912372646888991 MNO= OMNITEL. Session ID =8275846, Allowed Bytes= 20971520         | Event showing successfully open data session                                                                                                                                                                                 |
| Network registration of ICCID 8912372646888991 (123456789101112), MNO: OMNITEL                                                         | <p></p><p>Event showing successful registration to a network</p><p></p>                                                                                                                                                      |
| Success SCP\_INITIAL\_RESULT of Thing Name=ICCID 8912372646888991 IMSI=123456789101112. MNO=OMNITEL. Allowed quota=20971520 bytes.     | Event showing that SIM card has opened a new data session using APIN "uinternet"                                                                                                                                             |
| Success SCP\_UPDATE\_RESULT of Thing Name=ICCID 8912372646888991 IMSI=123456789101112. MNO=OMNITEL. Allowed quota=20971520 bytes.&#xD; | Event showing that SIM card data session using APN "uinternet" got updated to allow more data to be used                                                                                                                     |
| delete\_pdp\_context for Thing=ICCID 8912372646888991, Session ID=8275846, Used bytes=1270086                                          | Event showing that the data session was closed and mentioning used data amount                                                                                                                                               |
| ICCID 8912372646888991 used 1270086 bytes                                                                                              | Event showing how much data SIM card has used                                                                                                                                                                                |
| VLR PURGE\_MS request from 3706111111111                                                                                               | <p>Event showing that SIM card was purged (removed) from the network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>          |
| SGSN PURGE\_MS request from 370611111111                                                                                               | <p>Event showing that SIM card was purged (removed) from the used 2G/3G network. <br><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p> |
| MME PURGE\_MS request from lt-sto1-mme-1.epc.mnc003.mcc246.3gppnetwork.org                                                             | <p>Event showing that SIM card was purged (removed) from the used 4G network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>  |

To see most of the Event Messages and information about them, [please follow this link](https://docs.monogoto.io/guides/thing-menu-events/event-messages).

### Checking Thing Events Logs via an API command:

To view Thing Events logs, please use following request:

```
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_>>>\"}"
```

{% hint style="info" %}
Please note that the above shown command needs to be replaced with information: \
\&#xNAN;**<<<\_TOKEN\_HERE\_>>>** - replace with your token\
\&#xNAN;**<<<\_THING\_ICCID\_ID\_>>>** - replace with *ThingId\_ICCID\_ABC*, where *ABC* is your thing *ICCID*. Example: *ThingId\_ICCID\_8912372646888991*\
\&#xNAN;**<<<\_EVENT\_SEVERITY\_>>>** - replace with the severity of the Event you wish to be displayed.\
\&#xNAN;**<<<\_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.](https://www.epochconverter.com/)\
\&#xNAN;**<<<\_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.](https://www.epochconverter.com/)\
\&#xNAN;**<<<\_EVEN\_MESSAGE\_TYPE\_>>>** - replace with the Event message type to be displayed. \
\&#xNAN;**<<<\_RESULTS\_LIMIT\_>>>** - replace with how many results you want to be displayed. Default when not using this line is 10 results.
{% endhint %}

{% hint style="warning" %}
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
{% endhint %}

Example of request that will show last 50 Events for our Thing:

```
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\"}"
```

Expected result will show 50 last Events for our Thing:

```
{
  "totalResults": 151,
  "hits": [
    {
      "_source": {
        "EsDataType": "GGSN_AUTHENTICATE_PDP_CONTENT_RESULT",
        "Severity": "Info",
        "message": "Success authenticate_pdp_context for Thing ICCID 8912372646888991 MNO= UAB TELE2. Session ID =8993090, Allowed Bytes= 20971520",
        "Timestamp": 1609154365332,
        "MessageType": "EVENT"
      }
    },
    {
      "_source": {
        "EsDataType": "GGSN_AUTHENTICATE_PDP_CONTENT",
        "Severity": "Info",
        "message": "authenticate_pdp_context v2 for Thing=ICCID 8912372646888991 from SGSN 10.99.5.34 RAI=null . Allowed Bytes = 20971520",
        "Timestamp": 1609154365331,
        "MessageType": "EVENT"
      }
    },
    {
      "_source": {
        "EsDataType": "GGSN_DELETE_PDP_CONTENT",
        "Severity": "Info",
        "message": "delete_pdp_context for Thing=ICCID 8912372646888991, Session ID=8986961, Used bytes=18464019",
        "Timestamp": 1609154364198,
        "MessageType": "EVENT"
      }
      
      
      ...
```

Search in Thing Menu newest events for one of the below provided examples:

| Event Message example                                                                                                                     | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success authenticate\_pdp\_context for Thing ICCID 8997211240710951969 MNO= OMNITEL. Session ID =8275846, Allowed Bytes= 20971520         | Event showing successfully open data session                                                                                                                                                                                 |
| Network registration of ICCID 8997211240710951969 (240075817195196), MNO: OMNITEL                                                         | <p></p><p>Event showing successful registration to a network</p><p></p>                                                                                                                                                      |
| Success SCP\_INITIAL\_RESULT of Thing Name=ICCID 8997211101234564532 IMSI=425019700000453. MNO=OMNITEL. Allowed quota=20971520 bytes.     | Event showing that SIM card has opened a new data session using APIN "uinternet"                                                                                                                                             |
| Success SCP\_UPDATE\_RESULT of Thing Name=ICCID 8997211101234564532 IMSI=425019700000453. MNO=OMNITEL. Allowed quota=20971520 bytes.&#xD; | Event showing that SIM card data session using APN "uinternet" got updated to allow more data to be used                                                                                                                     |
| delete\_pdp\_context for Thing=ICCID 8912372646888991, Session ID=8275846, Used bytes=1270086                                             | Event showing that the data session was closed and mentioning used data amount                                                                                                                                               |
| ICCID 8912372646888991 used 1270086 bytes                                                                                                 | Event showing how much data SIM card has used                                                                                                                                                                                |
| VLR PURGE\_MS request from 37068499200                                                                                                    | <p>Event showing that SIM card was purged (removed) from the network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>          |
| SGSN PURGE\_MS request from 37068499200                                                                                                   | <p>Event showing that SIM card was purged (removed) from the used 2G/3G network. <br><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p> |
| MME PURGE\_MS request from lt-sto1-mme-1.epc.mnc003.mcc246.3gppnetwork.org                                                                | <p>Event showing that SIM card was purged (removed) from the used 4G network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>  |

To see most of the Event Messages and information about them, [please follow this link](https://docs.monogoto.io/guides/thing-menu-events/event-messages).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monogoto.io/advanced-console/platform/how-to-check-if-thing-is-connected/checking-thing-connection-via-event-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
