We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fun_args
1 parent 205c604 commit 56acb4bCopy full SHA for 56acb4b
examples/src/saltext/safexamples/process/jobs_to_es.py
@@ -46,9 +46,11 @@ async def process(
46
data = event.dict()
47
data.pop("data", None)
48
data.update(event.data)
49
- # Have the return field always be a JSON string
50
- if "return" in data:
51
- data["return"] = json.dumps(data["return"])
+ # Some field must be cast to JSON strings or EL will complain about
+ # different types
+ for key in ("fun_args", "return"):
52
+ if key in data:
53
+ data[key] = json.dumps(data[key])
54
data["@timestamp"] = event.start_time
55
evt = ElasticSearchEvent.construct(index="salt_jobs", data=data)
56
log.debug("ElasticSearchEvent: %s", pprint.pformat(evt.dict()))
0 commit comments