Splunk Search

How to I extract survey results from an event where question/answer pairs are delimited by "," and key-values are delimited by "|"?

hqw
Path Finder

Dear all,

I want to extract results from a field, but I'm facing some problems. Could you pls kindly guide me on what is wrong? The survey result is contained in the label and I have 11 questions in this survey:

surveyResult:Q1|B,Q2|B,Q3|A,Q4|A,Q5|B,Q6|B,Q7|A,Q8|B,Q9|B,QG|B,QA|D,Completed 

My expected result:

Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 QG QA
B  B  A  A  B  B  A  B  B  B  D 

Event:

action="Survey-launcher-temporary" label="|/mnt/sdcard/AppLoaderCache/CameraPreviews/31945694/20150626_095405|1435312470|1435312597|surveyResult:Q1|B,Q2|B,Q3|B,Q4|A,Q5|A,Q6|B,Q7|B,Q8|A,Q9|B,QG|A,QA|B,Completed" mount_description="FPH-JEM-F7R2. MountLocation:Laundry Care. M8" mount_id="05ddb79f0f8c11e5870e0647ae8d6515" shop_tags="xwalk-library, MassRebootTarget, M8, ZoneLocation-West, AreaLocation-Shopping-District, Hypermarket, Survey-AB, Singapore, Fairprice-JEM, Fairprice-Xtra, Fairprice, OutletLocation-Shopping-Mall, LIVE" timezone_id="Asia/Singapore" timezone_offset="28800000" value="0"
0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

This is a case for: Extract man!

action="Survey-launcher-temporary" | extract pairdelim="," kvdelim="|"

This should put your fields as you wish.

0 Karma

hqw
Path Finder

Hi alacercogitatus,

I tried this command, and i can get out the events, but nothing for statistics, it should due to that we didn't design the layouts, do you know how to improve this?

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...