Use following in search for Splunk App for AWS
index=your_aws_index sourcetype="aws:addon:account" | dedup host, account_id, name | fields - _time |dedup account_id| table name, account_id | outputlookup all_account_ids
This should help.
... View more