Knowledge Management

Tagging Data

JoshuaJJ
Path Finder

Good morning, 

 

 I recently created a tag for a set of hosts. For example, CA for all California hosts. Does this take time to populate or show up within my Data Models?  I am running a search similar to this 

| tstats count FROM datamodel=<data_model>.<root_event> WHERE tag=CA BY _time, host, etc....

 

I have also tried this 

| datamodel  <data_model> <root_event> search 

| search tag=CA

| table _time, host, etc....

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @JoshuaJJ ,

two topics:

is tag a field of your DataModel?

You can check this in your DataModel definition.

if not, you cannot use it or you have to modify your DataModel fields.

if yes, you have to use the <your_datamodel> prefix befor tag in the WHERE condition:

| tstats 
     count 
     FROM datamodel=<data_model>.<root_event> 
     WHERE <data_model>.tag=CA 
     BY _time host

Ciao.

Giuseppe

View solution in original post

0 Karma

JoshuaJJ
Path Finder

Thank you so much for the help. I always forget to add fields to the Data Model 🙂 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @JoshuaJJ ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @JoshuaJJ ,

two topics:

is tag a field of your DataModel?

You can check this in your DataModel definition.

if not, you cannot use it or you have to modify your DataModel fields.

if yes, you have to use the <your_datamodel> prefix befor tag in the WHERE condition:

| tstats 
     count 
     FROM datamodel=<data_model>.<root_event> 
     WHERE <data_model>.tag=CA 
     BY _time host

Ciao.

Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...