Skip to content

Commit 1755188

Browse files
committed
Expose published and author fields
Fixes #619
1 parent bf6ed38 commit 1755188

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

splunklib/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ def _parse_atom_entry(entry):
279279
"fields": metadata.fields,
280280
"content": content,
281281
"updated": entry.get("updated"),
282+
"published": entry.get("published"),
283+
"author": entry.get("author"),
282284
}
283285
)
284286

tests/integration/test_job.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from io import BytesIO
1818
from pathlib import Path
1919
from time import sleep
20+
from datetime import datetime
2021

2122
import io
2223

@@ -438,6 +439,17 @@ def test_v1_job_fallback(self):
438439
self.assertTrue(client.PATH_JOBS_V2 in self.job.path)
439440
self.assertEqual(n_events, n_preview, n_results)
440441

442+
def test_published_author_fields(self):
443+
jobs = self.service.jobs.list(name=self.job.name)
444+
self.assertEqual(len(jobs), 1)
445+
self.assertEqual(jobs[0].state.author.name, self.service.username)
446+
self.assertIsNotNone(jobs[0].state.published)
447+
datetime.fromisoformat(jobs[0].state.published) # make sure it is parsable
448+
449+
self.assertEqual(self.job.state.author.name, self.service.username)
450+
self.assertIsNotNone(self.job.state.published)
451+
datetime.fromisoformat(self.job.state.published) # make sure it is parsable
452+
441453

442454
if __name__ == "__main__":
443455
unittest.main()

tests/system/test_apps/modularinput_app/bin/modularinput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class ModularInput(Script):
2424
"""
25-
This app provides an example of a modular input that
25+
This app provides an example of a modular input that
2626
can be used in Settings => Data inputs => Local inputs => modularinput
2727
"""
2828

0 commit comments

Comments
 (0)