# Auto Installer of Intercom Activity Logs

### <span style="color: rgb(53, 152, 219);">**Overview**</span>

---

A lightweight, dependency-free Bash collector that polls the **Intercom Admin Activity Logs API** on an hourly schedule, flattens each event to a dot-notation NDJSON record, rotates output files at a configurable size, and automatically purges old archives — all running as a systemd user service with no root access required.

---

### <span style="color: rgb(53, 152, 219);">**Prerequisites**</span>

- **Intercom API token**
- **Intercom API Version**

---

### <span style="color: rgb(53, 152, 219);">Steps to generate an Intercom API Token</span>

1. Go to the official Intercom Developer Hub:  
    <span class="" data-state="closed">[Intercom Developer Hub](https://developers.intercom.com/?utm_source=chatgpt.com)</span>
2. Log in to your Intercom workspace.
3. Open your workspace’s **Developer Hub**: 
    - In Intercom, go to:  
        **Settings → Developer Hub → Your Apps**
4. Click **New App** (or “Create App”).
5. Enter: 
    - App name
    - Description (optional)
6. After creating the app: 
    - Open the app
    - Go to **Configure → Authentication**
7. You’ll see your **Access Token** there.
8. Copy the token and store it securely.
9. You can also find the API Version and copy as well.

---

#### <span style="color: rgb(53, 152, 219);">**Creating the setup installer**</span>

**Linux:**

1. **Login to the Log Collector.**
2. **Open Terminal and type the following commands.**
    - ```
        cd Documents
        ```
    - ```
        nano setup.sh
        ```
3. **Paste this Script <span style="color: rgb(45, 194, 107);">\*Contact Aquila Tech Support for the full source code</span>.**
    - ```
        Please Contact "Aquila Platform Defence and Technical Enablement" for the source code. Thank you!.
        ```
4. **Save the Script and change it to executable file**. 
    - ```
        chmod +x setup.sh
        ```
5. **Now execute the file.**
    - ```
        ./setup.sh
        ```
6. **Follow the on screen instruction to fully integrate the system**.

---

<p class="callout info">Provide the "activity\_logs.ndjson" Directory to Cytech Support for Integration.  
Example: /home/user/intercom/activity\_logs.ndjson</p>

---

***For the Back-end add this to Custom configurations:***

```yaml
processors:
  - decode_json_fields:
      fields: ["message"]
      target: ""
      overwrite_keys: true
      add_error_key: true
  - add_fields:
      target: event
      fields:
        module: intercom
  - add_fields:
      target: component
      fields:
        id: intercom-logs
```

---

***If you need further assistance, kindly contact our support at <span style="color: rgb(53, 152, 219);">support@cytechint.com</span> for prompt assistance and guidance.***