Getting Data In

Creating graphs on extracted values in a csv file

anirudhduggal
Engager

Hello All,

I have a csv file which has values like this

host, ports running
192.168.1.1, 80,8081,22
192.168.1.2, 80,21,8083
192.168.1.3, 22,23,8082

Now, I want to create graphs by extracting the unique values form each ports running field.

i.e. for this file the result should be
number of port 80 open - 2
number of port 22 open - 2
number of port 8081 open - 1
number of port 8082 open - 1
number of port 8083 open - 1

I have tried extracting fields however, I am not able to use these values as a unique value.

Anyone has faced a similar situation.
Thank you for reading this and thanks in advance 🙂

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

This should do:

... | makemv ports_running delim="," | stats count by ports_running

The makemv turns your comma-delimited string into a multi-value field, with one value per port. The stats then does the counting per port.

View solution in original post

anirudhduggal
Engager

Worked like a charm.
Just another thing. The last field that appears is a blank because the fields are ending with a comma (,) is there any way i can omit this field ?

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

This should do:

... | makemv ports_running delim="," | stats count by ports_running

The makemv turns your comma-delimited string into a multi-value field, with one value per port. The stats then does the counting per port.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...