Getting Data In

How to Ingest Splunk Lines starting with

whitefang1726
Path Finder

Hello, how can I ingest logs starting with a specific word:

Sample Log Entry:
SPLUNKD-123456: Hello World
Hello World123
Hello World456
Hello World789
SPLUNKD-0000: Hello World
SPLUNKD-0012: Hello World
Hello World0123
Hello World0456

Logs that will be ingested into Splunk:

SPLUNKD-123456: Hello World
SPLUNKD-0000: Hello World
SPLUNKD-0012: Hello World

Thanks!

 

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @whitefang1726,

let me understand: do you want to filter log before indexing and index only a subseto of events or do you want to index alla events and display in search only filtered events?

If you want to take only events that start with "SLUNKD" , you should see at https://docs.splunk.com/Documentation/Splunk/8.2.4/Forwarding/Routeandfilterdatad#Filter_event_data_... and put in your indexers or (if present) in your Heavy Forwarders the following conf files:

in props.conf:

[your_sourcetype]
TRANSFORMS-set= setnull,setparsing

in transforms.conf:

[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = ^SPLUNKD
DEST_KEY = queue
FORMAT = indexQueue

In the second case, you index all events and in your search you could run something liker this:

index=your_index sourcetype=your_sourcetype SPLUNKD
| ...

Ciao.

Giuseppe

PickleRick
SplunkTrust
SplunkTrust

Filtering on ingest is one way (relatively universal but adding load to your indexers/heavy forwarders). You can also try to prevent the entries from being picked up by the input but how to do that is highly dependent on where you have your events and how you are receiving/pulling them.

0 Karma
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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

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