Dashboards & Visualizations

Text loggin best practice

jondotnet
New Member

Hi Folks,

I am looking for some advice on the best way to create a text log.

Currently I am testing a log that is recording temperature probes like this:

2014-01-24,12:17:17,t1,19
2014-01-24,12:17:17,t2,21
2014-01-24,12:21:35,t1,18
2014-01-24,12:21:35,t1,22
etc.......

t1 & t2 are the 2 current active temperature probes that are read by a script and written to the log file every 5 minutes form a cron job

I will be adding more sensors in the future so was wondering if I would be better logging the data like this:

2014-02-14,15:57:57,t1=19,t2=21,t3=35
2014-02-14,15:59:13,t1=20,t2=22,t3=36

Thanks.

Tags (2)
0 Karma

dshpritz
SplunkTrust
SplunkTrust

You should check out the Logging best practices page on the Splunk Dev site.

Thanks,

Dave

dshpritz
SplunkTrust
SplunkTrust

Yes, very close, but here are some other points:

  • include a timezone with your timestamp
  • wrap and values or keys with spaces in quotes (there weren't any in your example, but it's something to keep in mind)
  • you might want to include a category

Also, you most likely don't need the commas in the event.

0 Karma

jondotnet
New Member

Hi,

Already had a look at that page but still not 100% sure on what its saying.

I think the line "key1=value1, key2=value2, key3=value3 . . ." is the same as my idea I listed but not sure.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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