Getting Data In

line_breaker help

renems
Communicator

I'm struggling getting my data to break to events. A REST call gives me a csv in a long straight line, without any character to break. Any help how to fix this?

This is what it looks like now:

svc;Time_Stamp;Omgeving;name;Locatie;capacity;free_capacity;virtual_capacity;real_capacity;overalloc;type;Storage_ClassIVB201;2016/01/2518:00:13CET;OTA;B_IVB201_HUB196_1;Best;62603443306496;32838246203392;34303903793152;29762410301440;54;thin;BronsIVB800;2016/01/2518:00:15CET;PRD;B_IVB800_HUB193_1;Best;62602906435584;2785286291456;59817088641536;59817088641536;95;THICK;Brons

This is what would make me happy:

svc;Time_Stamp;Omgeving;name;Locatie;capacity;free_capacity;virtual_capacity;real_capacity;overalloc;type;Storage_Class
IVB201;2016/01/25 18:00:13 CET;OTA;B_IVB201_HUB196_1;Best;62603443306496;32838246203392;34303903793152;29762410301440;54;thin;Brons
IVB800;2016/01/25 18:00:15 CET;PRD;B_IVB800_HUB193_1;Best;62602906435584;2785286291456;59817088641536;59817088641536;95;THICK;Brons

Bonuspoints for the right way to get rid of the header record. 🙂

Tags (1)
0 Karma
1 Solution

alemarzu
Motivator

Hi there Renems,

Try with this,

SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
SEDCMD=s/svc;.*?Storage_Class//g
LINE_BREAKER=([\r\n]*)(?:[A-Z]{1,}\d{1,})(?=;\d{4}\/\d{2}\/\d{4})

View solution in original post

0 Karma

alemarzu
Motivator

Hi there Renems,

Try with this,

SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
SEDCMD=s/svc;.*?Storage_Class//g
LINE_BREAKER=([\r\n]*)(?:[A-Z]{1,}\d{1,})(?=;\d{4}\/\d{2}\/\d{4})
0 Karma

somesoni2
Revered Legend

Give this a try (assuming your value of svc field is 6 character long always)

[ <SOURCETYPE NAME> ]
SHOULD_LINEMERGE=false
disabled=false
LINE_BREAKER=([\r\n]*)(?=\w{6};\d+\/\d+)
TIME_FORMAT=%Y/%m/%d%H:%M:%S%Z
TIME_PREFIX=^\w{6};
SEDCMD-removeheader=s/^(svc;.*)//
0 Karma

renems
Communicator

Thanks for the help. However, it's not the result I was hoping for. In fact, it doesn't seem to work.
Could it be because between the last word of the sentence, and the first one of the new one, there's no character in between? Any other suggestions?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What REST call is giving you those results?

---
If this reply helps you, Karma would be appreciated.
0 Karma

renems
Communicator

Yeah I know, it's not a very good one.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

There could be something in your REST call that can be changed to improve your results, but it's impossible to know for sure without seeing the command.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...