Splunk ITSI

How can I select only first line of a field to display

a1bg503461
Explorer

I am working on a KPI script and I need to deduplicate lines in the field 
Looks like this :
278.PNG

is there an | eval field= substr for first line of field  or some regex that can deduplicate my values. Thanks

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Are these multi-value fields?

| eval queue=mvindex(queue, 0)
| eval value=mvindex(value, 0)

If not, how did you get the values, perhaps they can be dedup'd before this point?

View solution in original post

0 Karma

a1bg503461
Explorer

mvindex works, THANKS! my bash script collects the log, I am still investigating why field gets doubled.

0 Karma

Farheen
Explorer

If you are getting these results from stats. You can try using latest function like below. However, it would be easier to address your question if you can share how you got this result.

|stats latest(queue) values(value) by some_other_field

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Are these multi-value fields?

| eval queue=mvindex(queue, 0)
| eval value=mvindex(value, 0)

If not, how did you get the values, perhaps they can be dedup'd before this point?

0 Karma
Get Updates on the Splunk Community!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...