Real-time temperature monitoring system for wind turbine rotor manufacturing machines, sending data directly to Splunk via HTTP Event Collector (HEC).
- Python 3.8+
- Splunk Enterprise/Cloud instance
- Splunk HTTP Event Collector (HEC) token
- Log in to your Splunk instance as an admin
- Navigate to Settings > Data Inputs > HTTP Event Collector
- Click "New Token"
- Configure the token:
- Name:
temperature_monitor
- Source type:
_json
- App Context: Search & Reporting
- Default Index: main
- Name:
- Click "Review" then "Submit"
- Save the generated token value for use in
.env
- Enable HEC:
- Go to Global Settings
- Set "All Tokens" to Enabled
- Set HTTP Port Number to 8088
- Click "Save"
- Clone the repository:
git clone https://github.com/FlorianBoehler/dlbingdabd01.git
cd dlbingdabd01
- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create
.env
file with your Splunk token:
SPLUNK_TOKEN=your_hec_token_here
Edit the following parameters in temperature_logger.py
:
splunk_host
: Splunk instance hostname/IPsplunk_port
: HEC port (default: 8088)num_machines
: Number of machines to monitorlocations
: List of facility locationsmin_temperature
: Define the minimal temperature (Default:60)max_temperatur
: Define the maximum temperature (Default:80)- Temperature thresholds and ranges
Start the real-time data generator:
python src/temperature_logger.py
Monitor the console for event transmission status. Use Ctrl+C to stop.
Real-time events include:
{
"timestamp": "2024-03-15T14:30:45.123",
"machine": "ROTOR_M01",
"temperature": 72.45,
"status": "NORMAL",
"location": "Hall_A",
"batch_id": "BATCH_1000"
}
- NORMAL: ≤75°C
- WARNING: 75-85°C
- CRITICAL: >85°C
The project includes a pre-configured dashboard (src/dashboard/temperature_dashboard.json
) with:
- Real-time temperature display for each measurement point (ROTOR_M01 to ROTOR_M05)
- Temperature trend line chart for all machines
- Warning table for temperatures above 75°C
- Green: Temperature ≤ 75°C
- Yellow: Temperature 75-85°C
- Red: Temperature > 85°C
# All measurement points
sourcetype=_json
| timechart span=1min avg(temperature) by machine
# Critical values
sourcetype=_json
| where temperature > 75
| bin _time span=30s
| table _time, machine, temperature
- Navigate to Splunk > Dashboards
- Click "Create New Dashboard"
- Select "Source Editor"
- Copy and paste the contents of
temperature_dashboard.json
- Save and view your dashboard
If events aren't appearing in Splunk:
- Verify HEC is enabled in Global Settings
- Check the token is correctly copied to
.env
- Ensure port 8088 is accessible
- Look for error messages in Splunk's internal logs