Splunk Search

What is the difference between eventtype and macro?

jip31
Motivator

Hi

Even if i have read some documentations, i have difficulty to understand the difference between macro and eventtype

I use macro essentially for index + sourcetype agregation but is somebody can clearly explaining me the difference between macro and eventtype?

Thanks

Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @jip31,

an eventtype is a search used to tag some events, in an eventtype you can put only the main search, in other words, you canot have pipes.

A macro is a part of code in which you can put many code statements (also with many pipes) with diferent following commands.

If you need only of a search e.g. with index and sourcetype), you can use both eventtype or macro, the main difference is that using a macro, you cannot associate a tag to your eventtype.

Ciao.

Giuseppe

 

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jip31,

an eventtype is a search used to tag some events, in an eventtype you can put only the main search, in other words, you canot have pipes.

A macro is a part of code in which you can put many code statements (also with many pipes) with diferent following commands.

If you need only of a search e.g. with index and sourcetype), you can use both eventtype or macro, the main difference is that using a macro, you cannot associate a tag to your eventtype.

Ciao.

Giuseppe

 

0 Karma

jip31
Motivator

Hi

Thanks its clear now

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jip31,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Macros are just text replacement and can be anything not just indexes/source types

0 Karma

jip31
Motivator

Yes i know

I just said that actually i use macro for grouping index + sourcetype but i know i can use other fields

But i come back to my question

What is the difference with eventtype ?

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