sondehub-infra/lambda/sqs_to_elk/__main__.py

15 lines
12 KiB
Python
Raw Normal View History

2021-12-20 06:02:02 +00:00
from . import *
lambda_handler(
{"Records": [ {"body": json.dumps({
"Type" : "Notification",
"MessageId" : "ac3ff6e4-dc9b-5429-9867-acdec910f1d3",
"TopicArn" : "arn:aws:sns:us-east-1:143841941773:sonde-telem",
"Message" : "[{\"software_name\": \"radiosonde_auto_rx\", \"software_version\": \"1.5.4\", \"uploader_callsign\": \"BARN5\", \"uploader_position\": \"48.950958,6.135996\", \"uploader_antenna\": \"1/4 wave monopole\", \"time_received\": \"2021-12-20T05:23:08.275935Z\", \"datetime\": \"2021-12-20T05:23:24.001000Z\", \"manufacturer\": \"Vaisala\", \"type\": \"RS41\", \"serial\": \"T1310890\", \"subtype\": \"RS41-SGP\", \"frame\": 2795, \"lat\": 49.36924, \"lon\": 7.49886, \"alt\": 13526.89728, \"temp\": -67.1, \"humidity\": 16.1, \"pressure\": 149.8, \"vel_v\": 2.84469, \"vel_h\": 22.2337, \"heading\": 134.28404, \"sats\": 9, \"batt\": 2.8, \"frequency\": 402.7, \"burst_timer\": 15902, \"snr\": 10.3, \"user-agent\": \"Amazon CloudFront\", \"position\": \"49.36924,7.49886\", \"upload_time_delta\": -1.463, \"uploader_alt\": 185.0}, {\"software_name\": \"radiosonde_auto_rx\", \"software_version\": \"1.5.4\", \"uploader_callsign\": \"BARN5\", \"uploader_position\": \"48.950958,6.135996\", \"uploader_antenna\": \"1/4 wave monopole\", \"time_received\": \"2021-12-20T05:23:09.181181Z\", \"datetime\": \"2021-12-20T05:23:25.001000Z\", \"manufacturer\": \"Vaisala\", \"type\": \"RS41\", \"serial\": \"T1310890\", \"subtype\": \"RS41-SGP\", \"frame\": 2796, \"lat\": 49.36909, \"lon\": 7.49908, \"alt\": 13532.5104, \"temp\": -67.0, \"humidity\": 15.5, \"pressure\": 149.64, \"vel_v\": 8.40014, \"vel_h\": 23.5398, \"heading\": 137.35364, \"sats\": 8, \"batt\": 2.7, \"frequency\": 402.7, \"burst_timer\": 15902, \"snr\": 10.1, \"user-agent\": \"Amazon CloudFront\", \"position\": \"49.36909,7.49908\", \"upload_time_delta\": -1.463, \"uploader_alt\": 185.0}, {\"software_name\": \"radiosonde_auto_rx\", \"software_version\": \"1.5.4\", \"uploader_callsign\": \"BARN5\", \"uploader_position\": \"48.950958,6.135996\", \"uploader_antenna\": \"1/4 wave monopole\", \"time_received\": \"2021-12-20T05:23:10.186732Z\", \"datetime\": \"2021-12-20T05:23:26.001000Z\", \"manufacturer\": \"Vaisala\", \"type\": \"RS41\", \"serial\": \"T1310890\", \"subtype\": \"RS41-SGP\", \"frame\": 2797, \"lat\": 49.36894, \"lon\": 7.4993, \"alt\": 13538.89727, \"temp\": -67.0, \"humidity\": 15.3, \"pressure\": 149.5, \"vel_v\": 3.88558, \"vel_h\": 23.33546, \"heading\": 137.92239, \"sats\": 9, \"batt\": 2.7, \"frequency\": 402.7, \"burst_timer\": 15902, \"snr\": 9.9, \"user-agent\": \"Amazon CloudFront\", \"position\": \"49.36894,7.4993\", \"upload_time_delta\": -1.463, \"uploader_alt\": 185.0}, {\"software_name\": \"radiosonde_auto_rx\", \"software_version\": \"1.5.4\", \"uploader_callsign\": \"BARN5\", \"uploader_position\": \"48.950958,6.135996\", \"uploader_antenna\": \"1/4 wave monopole\", \"time_received\": \"2021-12-20T05:23:11.192482Z\", \"datetime\": \"2021-12-20T05:23:27.001000Z\", \"manufacturer\": \"Vaisala\", \"type\": \"RS41\", \"serial\": \"T1310890\", \"subtype\": \"RS41-SGP\", \"frame\": 2798, \"lat\": 49.36878, \"lon\": 7.49952, \"alt\": 13544.98645, \"temp\": -66.9, \"humidity\": 15.1, \"pressure\": 149.29, \"vel_v\": 8.19858, \"vel_h\": 23.61324, \"heading\": 137.41834, \"sats\": 7, \"batt\": 2.7, \"frequency\": 402.7, \"burst_timer\": 15902, \"snr\": 9.9, \"user-agent\": \"Amazon CloudFront\", \"position\": \"49.36878,7.49952\", \"upload_time_delta\": -1.463, \"uploader_alt\": 185.0}, {\"software_name\": \"radiosonde_auto_rx\", \"software_version\": \"1.5.4\", \"uploader_callsign\": \"BARN5\", \"uploader_position\": \"48.950958,6.135996\", \"uploader_antenna\": \"1/4 wave monopole\", \"time_received\": \"2021-12-20T05:23:12.298679Z\", \"datetime\": \"2021-12-20T05:23:28.001000Z\", \"manufacturer\": \"Vaisala\", \"type\": \"RS41\", \"serial\": \"T1310890\", \"subtype\": \"RS41-SGP\", \"frame\": 2799, \"lat\": 49.36863, \"lon\": 7.49974, \"alt\": 13551.28573, \"temp\": -67.0, \"humidity\": 15.1, \"pressure\": 149.2, \"vel_v\": 4.18856, \"vel_h\": 23.79089, \"heading\": 136.0238, \"sats\": 9, \"batt\": 2.8, \"frequency\": 402.7, \"burst_timer\": 15902, \"snr\": 10.2, \"user-agent\": \"Amazon CloudFront\", \"position\": \"49.36863,7.49974\", \"upload_tim
"Timestamp" : "2021-12-20T05:23:23.523Z",
"SignatureVersion" : "1",
"Signature" : "WHop4RM+0qm/Q/fyvSZ1Zsnu7NXNnQjLqp5UsJy0LXCy51heeHPdg4pOOuOECit/lcmHBXF2w8r2mhqg/3CstP5BClGUNnBFEZ3mUlz9ia1y3LZvBbyl8ls1/fJg39ooULXXfe1I+2NgQD580rV34KMcF6LDuguHmdb++yTLupRvZc9AKlrpY+VYvALE5ZwQTjqZ6+Y1HSqQXvuYj6PTWxJics68ddRv1ddMWS2jXp3N7cLPNbqW0CiiNBNewlMlIXFoGa/liSjai3Ix3YW83HFcFsAE+s4moHhQHx3xmTlmaRhzNwZreF7dzzuv9tZ2zrx51nXqG+0+rf32sQ6MZQ==",
"SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem",
"UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:143841941773:sonde-telem:1a52ac41-6e17-43da-bfb6-114577c94ca6"
})}]}
,{})