Splunk Search

How to add a first column to number each row in a table so when I export to csv, the results are a list of numbered items?

jimmy_ford
New Member

I have a search with a table as an output, but I want to add the first column to number each row so when I export to csv, the consumers can see the number of items easily. The current search I am using:

index=* action!=blocked dest_ip=< ip's > action!=blocked | dedup src_ip | table _time, src_ip, dest_ip, action, url
Tags (4)
0 Karma

ramdaspr
Contributor
index=* action!=blocked dest_ip=< ip's > action!=blocked | dedup src_ip | table _time, src_ip, dest_ip, action, url | streamstats count as row | fields row *

jimmy_ford
New Member

Thank you but for some reason I see two now.....

blank Row _time
1 1

0 Karma

ramdaspr
Contributor

Can you change the endin to fields row,_time, src_ip, dest_ip, action, url

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...