dashy: merge link and description into one line with short date+time
This commit is contained in:
@@ -35,17 +35,13 @@ def fetch_transitions():
|
|||||||
def to_dashy_entry(t):
|
def to_dashy_entry(t):
|
||||||
rule_name = t["summary"].removeprefix("Falco rule fired - ")
|
rule_name = t["summary"].removeprefix("Falco rule fired - ")
|
||||||
status = t["new"]["status"]
|
status = t["new"]["status"]
|
||||||
local_time = datetime.datetime.fromtimestamp(t["when"], LOCAL_TZ).strftime("%-I:%M %p")
|
when = datetime.datetime.fromtimestamp(t["when"], LOCAL_TZ).strftime("%-m/%-d %-I:%M%p").lower()
|
||||||
return {
|
return {
|
||||||
"link": {
|
"link": {
|
||||||
"text": "View",
|
"text": f"{when} - {status} - {rule_name}",
|
||||||
"url": f"{NETDATA_URL}/",
|
"url": f"{NETDATA_URL}/",
|
||||||
"title": f"{status}: {rule_name}",
|
"title": f"{status}: {rule_name}",
|
||||||
},
|
},
|
||||||
"value": {
|
|
||||||
"text": f"{local_time} - {status} - {rule_name}",
|
|
||||||
"title": "Falco",
|
|
||||||
},
|
|
||||||
"date": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(t["when"])),
|
"date": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(t["when"])),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user