Getting Data In

How do I convert 'LastPhoneHome' value to time format?

pfabrizi
Path Finder

I am building a DB to manage newly installed UF devices as well as the de-installed UF devices. I was wondering I was wondering how to convert the lastphonehome value to a readable time?

Thanks!

I am using the REST API in C#

Tags (3)
0 Karma
1 Solution

pfabrizi
Path Finder

In c#

DateTime LastPhoneHome = DateTime.AddSeconds(lastphonehome).ToLocalTime();

View solution in original post

0 Karma

pfabrizi
Path Finder

In c#

DateTime LastPhoneHome = DateTime.AddSeconds(lastphonehome).ToLocalTime();

0 Karma

niketn
Legend

@pfabrizi, you can use C# to convert time from Unix Epoch time to String Time.

In Splunk you can try the following Search

| rest splunk_server=local /services/deployment/server/clients
| fieldformat lastPhoneHomeTime=strftime(lastPhoneHomeTime,"%Y/%m/%d %H:%M:%S.%3N")
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

pfabrizi
Path Finder

Thank You, I have it working. appreciate your help.

0 Karma

niketn
Legend

@pfabrizi, that's really great!!! If you figured out solution on your own may be you can add the approach as Answer and accept the same to mark this question as answered.

Happy Weekend 🙂

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...