Splunk Enterprise Security

What is the use drop_dm_object_name() clause in a query with tstats.?

Abhi89
New Member

I am trying to find out what purpose drop_dm_object_name() serves.

0 Karma

smoir_splunk
Splunk Employee
Splunk Employee

That macro just changes the name of fields in data models to be just the field name, instead of the relative name in the data model. So a dataset would go from: Authentication.user to just "user" after using that macro.

0 Karma

Jishnukn10
New Member

what is macro?

0 Karma

kkrises
Path Finder

@Jishnukn10 - 

Search macros in Splunk are reusable chunks of Search Processing Language (SPL) that you can insert into other searches. It's enclosed within acute/back quotes `macro_name` on your search like  `drop_dm_object_name(field)`. You can see these macros in Splunk and define them under Settings > Advanced Search > Search Macros.

All about macros here : 

Use search macros in searches - Splunk Documentation

Hope this helps. 

0 Karma

Keysofsandiego
Path Finder

A macro is a rule that shows how a certain input should be mapped to a replacement output

To expand a macro in splunk - use CTRL + SHIFT + e

And to OP - drop_dm_object_name removes the leading stuff from a data model.
DM fields (not index, host, sourcetype etc) but the ones you create as custom all have leading words infront of the field.
In a typical authentication DM for example all the fields have a leading "Authentication." prefix.
Authentication.user, Authentication.tag, Authentication.app etc.
drop_dm_object just drops the "Authentication." part.

Cheers

 

 

Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...