Getting Data In

splitting data and saving the each result

changwoo
Communicator

i have raw data like

  1. cat | dog | ele

  2. cat | dog

  3. dog | ele

this field name is catego
result should be counting like this => cat = 2, dog =3, ele =2

sourcetype=movie | eval n= split(genre,"|") |table count(n) by n < = this is not splitting the string

Tags (1)
1 Solution

Ayn
Legend

OK, some issues here.

For one, the field name is catego, but in your search you use "genre"?
And then, table is no statistical command. It only shows the fields you supply as arguments. count(n) is no field, neither is "by".

Maybe you want something like this:

sourcetype=movie | eval n=split(catego,"|") | stats count by n

View solution in original post

Ayn
Legend

OK, some issues here.

For one, the field name is catego, but in your search you use "genre"?
And then, table is no statistical command. It only shows the fields you supply as arguments. count(n) is no field, neither is "by".

Maybe you want something like this:

sourcetype=movie | eval n=split(catego,"|") | stats count by n

changwoo
Communicator

oh ... my mistake!

the table name is genre 🙂

thanks!

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...