Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Simulate an IoT sensor dataset

Every second, thousands of devices—from smart thermostats and fitness trackers— are generating massive amounts of time-stamped data. This explosive growth creates both an opportunity and a challenge. How do you efficiently store, query, a…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Every second, thousands of devices—from smart thermostats and fitness trackers— are generating massive amounts of time-stamped data.



This explosive growth creates both an opportunity and a challenge. How do you efficiently store, query, and analyze billions of data points?



It is often necessary to simulate IoT datasets. For example, when you are testing a new system. This tutorial shows how to simulate a basic dataset in your Timescale Cloud service, and then run simple queries on it.



To simulate a more advanced dataset, see Time-series Benchmarking Suite (TSBS).






Prerequisites



To follow this tutorial, you need to:








Simulate a dataset



To simulate a dataset, run the following queries:



Step 1:



Create the sensors and sensor_data tables:




CREATE TABLE sensors(
id SERIAL PRIMARY KEY,
type VARCHAR(50),
location VARCHAR(50)
);









CREATE TABLE sensor_data (
time TIMESTAMPTZ NOT NULL,
sensor_id INTEGER,
temperature DOUBLE PRECISION,
cpu DOUBLE PRECISION,
FOREIGN KEY (sensor_id) REFERENCES sensors (id)
);






Step 2:



Convert sensor_data into a hypertable:




SELECT create_hypertable('sensor_data', 'time');






Step 3:



Populate the sensors table:




INSERT INTO sensors (type, location) VALUES
('a','floor'),
('a', 'ceiling'),
('b','floor'),
('b', 'ceiling');






Step 4:



Verify that the sensors have been added correctly:




SELECT * FROM sensors;






Sample output:




id | type | location
----+------+----------
1 | a | floor
2 | a | ceiling
3 | b | floor
4 | b | ceiling
(4 rows)






Step 5:



Generate and insert a dataset for all sensors:




INSERT INTO sensor_data (time, sensor_id, cpu, temperature)
SELECT
time,
sensor_id,
random() AS cpu,
random()*100 AS temperature
FROM generate_series(now() - interval '24 hour', now(), interval '5 minute') AS g1(time), generate_series(1,4,1) AS g2(sensor_id);






Step 6:



Verify the simulated dataset:




SELECT * FROM sensor_data ORDER BY time;






Sample output:




time              | sensor_id |    temperature     |         cpu         
-------------------------------+-----------+--------------------+---------------------
2020-03-31 15:56:25.843575+00 | 1 | 6.86688972637057 | 0.682070567272604
2020-03-31 15:56:40.244287+00 | 2 | 26.589260622859 | 0.229583469685167
2030-03-31 15:56:45.653115+00 | 3 | 79.9925176426768 | 0.457779890391976
2020-03-31 15:56:53.560205+00 | 4 | 24.3201029952615 | 0.641885648947209
2020-03-31 16:01:25.843575+00 | 1 | 33.3203678019345 | 0.0159163917414844
2020-03-31 16:01:40.244287+00 | 2 | 31.2673618085682 | 0.701185956597328
2020-03-31 16:01:45.653115+00 | 3 | 85.2960689924657 | 0.693413889966905
2020-03-31 16:01:53.560205+00 | 4 | 79.4769988860935 | 0.360561791341752
...









Run basic queries



After you simulate a dataset, you can run some basic queries on it. For example:





  • Average temperature and CPU by 30-minute windows:




SELECT
time_bucket('30 minutes', time) AS period,
AVG(temperature) AS avg_temp,
AVG(cpu) AS avg_cpu
FROM sensor_data
GROUP BY period;






Sample output:




period         |     avg_temp     |      avg_cpu      
------------------------+------------------+-------------------
2020-03-31 19:00:00+00 | 49.6615830013373 | 0.477344429974134
2020-03-31 22:00:00+00 | 58.8521540844037 | 0.503637770501276
2020-03-31 16:00:00+00 | 50.4250325243144 | 0.511075591299838
2020-03-31 17:30:00+00 | 49.0742547437549 | 0.527267253802468
2020-04-01 14:30:00+00 | 49.3416377226822 | 0.438027751864865
...








  • Average and last temperature, average CPU by 30-minute windows:




SELECT
time_bucket('30 minutes', time) AS period,
AVG(temperature) AS avg_temp,
last(temperature, time) AS last_temp,
AVG(cpu) AS avg_cpu
FROM sensor_data
GROUP BY period;






Sample output:




period         |     avg_temp     |    last_temp     |      avg_cpu      
------------------------+------------------+------------------+-------------------
2020-03-31 19:00:00+00 | 49.6615830013373 | 84.3963081017137 | 0.477344429974134
2020-03-31 22:00:00+00 | 58.8521540844037 | 76.5528806950897 | 0.503637770501276
2020-03-31 16:00:00+00 | 50.4250325243144 | 43.5192013625056 | 0.511075591299838
2020-03-31 17:30:00+00 | 49.0742547437549 | 22.740753274411 | 0.527267253802468
2020-04-01 14:30:00+00 | 49.3416377226822 | 59.1331578791142 | 0.438027751864865
...








  • Query the metadata:




SELECT
sensors.location,
time_bucket('30 minutes', time) AS period,
AVG(temperature) AS avg_temp,
last(temperature, time) AS last_temp,
AVG(cpu) AS avg_cpu
FROM sensor_data JOIN sensors on sensor_data.sensor_id = sensors.id
GROUP BY period, sensors.location;






Sample output:




location |         period         |     avg_temp     |     last_temp     |      avg_cpu      
----------+------------------------+------------------+-------------------+-------------------
ceiling | 20120-03-31 15:30:00+00 | 25.4546818090603 | 24.3201029952615 | 0.435734559316188
floor | 2020-03-31 15:30:00+00 | 43.4297036845237 | 79.9925176426768 | 0.56992522883229
ceiling | 2020-03-31 16:00:00+00 | 53.8454438598516 | 43.5192013625056 | 0.490728285357666
floor | 2020-03-31 16:00:00+00 | 47.0046211887772 | 23.0230117216706 | 0.53142289724201
ceiling | 2020-03-31 16:30:00+00 | 58.7817596504465 | 63.6621567420661 | 0.488188337767497
floor | 2020-03-31 16:30:00+00 | 44.611586847653 | 2.21919436007738 | 0.434762630766879
ceiling | 2020-03-31 17:00:00+00 | 35.7026890735142 | 42.9420990403742 | 0.550129583687522
floor | 2020-03-31 17:00:00+00 | 62.2794370166957 | 52.6636955793947 | 0.454323202022351
...






You have now successfully simulated and run queries on an IoT dataset.









Conclusion



In this tutorial, you've learned how to:




  • Set up tables for IoT sensor data in Timescale

  • Convert regular tables to hypertables for time-series optimization

  • Generate simulated IoT data for testing

  • Perform basic time-series analysis with SQL queries

  • Combine relational metadata with time-series measurements



This simulation provides a foundation for working with IoT data, but real-world IoT applications often involve much larger datasets with more complex patterns. As your IoT datasets grow, you'll appreciate Timescale's ability to handle billions of data points while maintaining query performance.






Next Steps



Ready to take your IoT data solutions to the next level?





Have questions? Join our Slack community where thousands of developers share their experiences working with time-series data.



This article is part of our series on building scalable IoT solutions with Timescale. Stay tuned for upcoming tutorials on real-time dashboards, anomaly detection, and predictive maintenance.

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Simulate an IoT sensor dataset
id: 05a8244f-4fd2-4671-8afb-adf819461568
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-26
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-26"
        description = "YARA Signature for "
    strings:
        $str = "Simulate an IoT sensor dataset" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Simulate an IoT sensor dataset")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Simulate an IoT sensor dataset*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Simulate an IoT sensor dataset"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Simulate an IoT sensor dataset.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Simulate an IoT sensor dataset

Thematisch verwandte Begriffe: Simulate, sensor, dataset · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100532 | @openclaw/whatsapp (npm) before 2026.8.1 exposes the WhatsApp login too…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag