This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-16
Channels
- # announcements (33)
- # asami (37)
- # autochrome-github (1)
- # aws (5)
- # babashka (26)
- # babashka-sci-dev (18)
- # beginners (63)
- # biff (1)
- # calva (66)
- # cider (15)
- # clj-kondo (24)
- # cljs-dev (2)
- # cljsrn (14)
- # clojure (62)
- # clojure-doc (1)
- # clojure-europe (15)
- # clojure-nl (11)
- # clojure-spec (12)
- # clojure-uk (4)
- # clojurescript (45)
- # community-development (2)
- # cursive (34)
- # datahike (7)
- # datomic (7)
- # events (1)
- # figwheel-main (5)
- # fulcro (19)
- # gratitude (7)
- # holy-lambda (85)
- # hyperfiddle (4)
- # jobs (7)
- # jobs-discuss (25)
- # kaocha (4)
- # lsp (11)
- # off-topic (1)
- # polylith (20)
- # portal (14)
- # practicalli (6)
- # proletarian (5)
- # rdf (52)
- # re-frame (13)
- # reagent (48)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (7)
- # tools-deps (17)
{:field "@timestamp", :value "2022-02-16 03:00:23.196"}
what is the best way to read this cloudwatch log timestamp?
@U02CV2P4J6S Can you be more specific about what you’re asking? I’m not sure if you mean read it in a query in CloudWatch or some other utility. However, I’m pretty sure you don’t mean physically read it 😅
@U02CV2P4J6S i'm going to take a guess at what you mean. The answer is using the AWS client-cloud-watch logs SDK, either java (clj) or javascript (node).
for example here is me reading some logs:
(ns core3
(:require [cljs.core.async :refer [go]]
[cljs.core.async.interop :refer-macros [<p!]]
[common.transit :as transit]
[common.json :refer [json->clj]]
["@aws-sdk/client-cloudwatch-logs" :refer (CloudWatchLogsClient FilterLogEventsCommand)]
[clojure.string :as str]
[tick.alpha.api :as t]))
(def client (new CloudWatchLogsClient #js{:region "us-east-1"}))
(def command (new FilterLogEventsCommand #js{:logGroupName "/aws/lambda/drew-dev-EqlRoute"
:filterPattern "eql"
:startTime 1644887463000
:limit 100
}))
(def r (atom nil))
(go
(try
(reset! r
(<p! (.send client command)))
(catch js/Error err (js/console.log (str "err: " err)))))
@U0DJ4T5U1 thanks for the example