- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Extract count of each value of a field and create a timechart from it using stats
priyangshupal
Engager
10-29-2021
12:23 AM
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

tread_splunk

Splunk Employee
10-29-2021
04:34 AM
But if you really want to introduce the V1, V2, V3 field names you'll need...
index=_* index=_internal sourcetype=splunkd
| rename component as skill
| timechart span=5m count by skill limit=0
| untable _time skill count
| sort skill, _time
| streamstats dc(skill) as counter
| eval fieldnameReq="v".counter
| timechart span=5m sum(count) by fieldnameReq limit=0
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

tread_splunk

Splunk Employee
10-29-2021
04:32 AM
I think this is what you mean. The hardest part is introducing the v1,v2,v3 etc field names.
If you're happy to retain the skill values, i.e. F1, F2, F3 (in your screenshot above) as the field names, then this becomes much simpler i.e....
index=_* index=_internal sourcetype=splunkd
| rename component as skill
| timechart span=5m count by skill limit=0
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

tread_splunk

Splunk Employee
10-29-2021
04:18 AM
Something like this...
index=_* index=_internal sourcetype=splunkd
| rename component as skill
| stats count by skill
| streamstats count as counter
| eval fieldnameReq="v".counter,stub="sum"
| chart sum(count) over stub by fieldnameReq limit=0
| fields - stub
Replace first 2 lines with your query. Working on another post that produces a timechart. 2 tics
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

tread_splunk

Splunk Employee
10-29-2021
04:51 AM
Neater solution, using transpose command.
index=_* index=_internal sourcetype=splunkd
| rename component as skill
| stats count by skill
| streamstats count as counter
| eval fieldnameReq="v".counter
| fields - counter skill
| transpose header_field=fieldnameReq
