Getting Data In

how to drop events containing null values coming from a csv using transforms

learnsplungeek
Loves-to-Learn Everything

Hi 
I am getting some events from a csv which contains the below format and would like to drop such events using transforms. 

null,null,0,null,null,null,null,null,null,  ---- to be dropped
null,null,0,null,null,null,null,null,null,  ---- to be dropped
null,null,0,null,null,null,null,null,null,  ---- to be dropped
null,null,0,null,null,null,null,null,null,  ---- to be dropped
null,null,0,null,null,null,null,null,null,  ---- to be dropped
52376,null,0,test,87387,2984,22,abc,99  ----- to be kept

Below is what i have done so far and is not working

Props.conf
[Reports5min]
TRANSFORMS-null = setnull


transforms.conf
[setnull]
REGEX = ^null,null\,0,null,null,null,null,null,null,$
DEST_KEY = queue
FORMAT = nullQueue

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

1. Where are you putting those configs?

2. Do you use indexed extractions?

0 Karma

learnsplungeek
Loves-to-Learn Everything

Hi , I have placed both the transforms and props at indexer layer. We are getting the CSV data through UF's

0 Karma

glc_slash_it
Path Finder

Assuming the stanza [Reports5min] points to the right sourcetype, try placing a capture group in the regex property, like this:

REGEX = ^(null,null,0,null,null,null,null,null,null,)$

Also are you sure there is ni blacnk spaces at the end of each line?

The rest of the settinggs seems fine.

 

0 Karma

learnsplungeek
Loves-to-Learn Everything

I tried the regex and it did not work 😞

0 Karma

learnsplungeek
Loves-to-Learn Everything

Hi , Sure let me try this regex and see. Yes there are no blank spaces after each line containing null values

0 Karma

learnsplungeek
Loves-to-Learn Everything

Hi @woodcock @niketn 

Please help me here 

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...