Other Usage

Why does field not populate in report but does when running the search?

Gregski11
Contributor

We have a scheduled report that used to work, and now one of the six fields does not populate in the report, ie shows no values, however when we run the search just as a regular search all fields populate including that one

the field is called SystemUpTime

| eval SystemUpTime=tostring(SystemUpTime,"duration") | table host, SystemUpTime ]

Labels (1)
0 Karma

woodcock
Esteemed Legend

It is silly to post a problem with a search and not post the entire search (slightly redacted if necessary, which it usually is not).  Since you have given us almost nothing to go on, I will answer what can be said.  There are 2 main things that can be wrong with that line. EITHER the 'SystemUpTime' field does not exist at all before that line hits OR it is negative.  If it is the latter, you can fix like this:

| fieldformat SystemUpTime = if(SystemUpTime < 0, "-", "") . tostring(abs(SystemUpTime), "duration")

Like this:

 

| makeresults | eval _raw="
host SystemUpTime
foo  -1
bar  0
bat  1"
| multikv forceheader=1
| fieldformat SystemUpTime = if(SystemUpTime < 0, "-", "") . tostring(abs(SystemUpTime), "duration")
| table host, SystemUpTime

 

 
 

 

0 Karma

Gregski11
Contributor

you are right I am sorry, before I post the full query I just want to say that this report used to work and we made no changes to the query or to the report and just this one field out of six stopped populating 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Permissions difference?

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...