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!

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