roobert / cloudwatch-loki-shipper

20 stars 10 forks source link

Couldn't find shipper push log on grafana Loki #1

Open kush2100 opened 4 years ago

kush2100 commented 4 years ago

I have configure Lambda function and try to push log on Grafana Loki, but unfortunately couldn't find log on Grafana Loki. I run query {driver="Python",location=""us-west-2",name=~"loki.*"} Confi but didn't find any log . I can see on Lambda cloudwatch log, it's show fine but when i check on Grafana Loki , i didn't find any log.

nicolas-porta commented 4 years ago

Did you configure a log group subscription to the Loki shipper lambda you created?

kush2100 commented 4 years ago

In my scenario, the cloud watch log triggers Lambda Function and pushes the log in Grafana Loki in realtime. I can't find log in Loki Grafana. Can you please help me with configuring lambda to push log in Grafana Loki. When cloudwatch trigger Lambda get :

START RequestId: 9c837c0f-fa34-465c-9c4f-f1c434b112e7 Version: $LATEST

executing lambda: loki-shipper-2

{'logGroup': 'MM-STAG-WEB'}

log entry: {'id': '35524596374922241163927105570172668568540282778579304448', 'timestamp': 1592977995070, 'message': '10.0.8.145 - - [24/Jun/2020:05:53:14 +0000] "POST /blog/wp-admin/admin-ajax.php HTTP/1.1" 200 4 "https://stag.mm.com/blog/wp-admin/post.php?post=134056&action=edit" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36" ""'}

processed log entry: ['1592977995.07', '10.0.8.145 - - [24/Jun/2020:05:53:14 +0000] "POST /blog/wp-admin/admin-ajax.php HTTP/1.1" 200 4 "https://stag.mm.com/blog/wp-admin/post.php?post=134056&action=edit" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36" ""'], log labels: {'logGroup': 'MM-STAG-WEB'}

sending request to: http://172.31.37.222:3100/loki/api/v1/push, payload: {'streams': [{'stream': {'logGroup': 'MM-STAG-WEB'}, 'values': [['1592977995.07', '10.0.8.145 - - [24/Jun/2020:05:53:14 +0000] "POST /blog/wp-admin/admin-ajax.php HTTP/1.1" 200 4 "https://stag.mm.com/blog/wp-admin/post.php?post=134056&action=edit" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36" ']]}]}

/var/runtime/botocore/vendored/requests/api.py:72: DeprecationWarning: You are using the post() function from 'botocore.vendored.requests'. This dependency was removed from Botocore and will be removed from Lambda after 2021/01/30. https://aws.amazon.com/blogs/developer/removing-the-vendored-version-of-requests-from-botocore/. Install the requests package, 'import requests' directly, and use the requests.post() function instead.

DeprecationWarning

request failed: loghttp.PushRequest.Streams: []*loghttp.Stream: loghttp.Stream.Entries: []loghttp.Entry: unmarshalerDecoder: strconv.ParseInt: parsing "1592977995.07": invalid syntax, error found in #10 byte of ...|45.112\""]]}]}|..., bigger context ...|afari/537.36\" \""]]}]}|...

lambda processing complete

END RequestId: 9c837c0f-fa34-465c-9c4f-f1c434b112e7

REPORT RequestId: 9c837c0f-fa34-465c-9c4f-f1c434b112e7 Duration: 29.11 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 56 MB