Splunk Search

Change Delimeter for Export CSV

jack_sumatra
Explorer

Just a quick question. I have no experience on Splunk, but my company just use it to collect data.

My Splunk Query search :

 

sourcetype=st_file| fillnull clientTransactionID msisdn ocsID orderID applicationID productType providerName reponseCode responsedetail reponseMessage actiontype bNumber gatewayTransactionID | stats count as trx by _time clientTransactionID msisdn ocsID orderID applicationID productType providerName reponseCode responsedetail reponseMessage actiontype bNumber gatewayTransactionID

 

 

Then the result will be export to csv file like this :

 

"_time",clientTransactionID,msisdn,ocsID,orderID,applicationID,productType,providerName,reponseCode,responsedetail,reponseMessage,actiontype,bNumber,gatewayTransactionID,trx

"2020-10-17T17:20:00.000+0700",023029300002187960,6281220636564,TC01,0,RBT0000,SP,RBT,2,"0|1630429199000|65","CHARGING_SUCCEEDED",F,000,"RBT0000:023029300002187960",1

 

 Can anyone suggest me how to change delimiter from '"," to "|" on my search query? 

I already read that we can change it from conf. files but since  I can't get access to those files, so i have no clue here. 

 

Thank you

Labels (2)
Tags (3)

inventsekar
SplunkTrust
SplunkTrust

Hi @jack_sumatra do you get the csv file thru outputcsv command or just search results export option?

ok, the simplest idea would be, doing some post-processing methods.,

ie, after getting the csv file, you can use notepad or vi editor for linux and do "search and replace" all "," to "|"

or, do you get the csv report thru alert/report?, if so, there may be some ideas.

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !

jack_sumatra
Explorer

I got the csv file from export option. 

Thank you for the tricks, it works with small data.

But can you help me with search query to replace delimiter, because with large data results my laptop just give up to open it. 😂

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...