I've been using Splunk 6.4 to create a set dashboard panels. I've come a across an issue where I have the following query:
index=index Category="$Category1$" | eval eval1=substr(field1,1,7) | top limit=$TopNo1$ eval_1 | fields - percent
This query works perfectly when I first write and save it to a panel. However, once I leave the dashboard and come back into it, the panel no longer returns anything because the query has been changed to this:
index=index Category="$Category1$" | eval eval1=substr(field1,1,7) | top limit=$TopNo1$ eval_1 | fields-percent
The spaces in the fields section get removed. Instead of removing the percent field, it tries to show only the -percent field, which does not exist. Now it doesn't seem to matter what I try with that fields, if I try "percent", or try moving that segment to the middle of the query. Both of these tweaks work at first, but ultimately the spaces get removed.
Sometimes this query does stay the way I need it to. However, on the same dashboard, I have a second panel which faces the same problem. What then becomes the case is that one panel will be fine, but the other is broken, and when I fix the second panel, the first panel breaks, and then vice versa if I fix the first panel.
I have tried going directly into the source and making changes there, but the same issue occurs.
So my question is, has anyone ever encountered this problem before? Can anyone suggest a work around?
I'm using Internet Explorer 11. I'm only permitted to use this browser on my work laptop, so I don't know if this happens on different browsers.
index=index Category="$Category_1$" | eval eval_1=substr(field_1,1,7) | top limit=$TopNo_1$ eval_1 | fields - percent `comment("comment text")`
index=index Category="$Category_1$" | eval eval_1=substr(field_1,1,7) | top limit=$TopNo_1$ eval_1 | fields - percent | noop
I tried adding the noop command. Same thing, the spaces get removed. I apply the change to one of my panels, and it sticks. However, the other panel then breaks. And then vice versa if I apply the change to the second panel, the first panel breaks again because the spaces get removed.
I tried adding the comment as suggested above, but the syntax does not work for me.
It appears that the comment macro was shipped in Splunk 6.5. The documentation for 6.4 shows how to create the macro.
However, I don't think this will solve your issue if the noop didn't work. It was a long shot and I thought the removal of the spaces may have been related to whether the fields command was the last portion of the search, and maybe adding 'extras' may have fooled the system into not removing the spaces.
Yeah, I had the same thinking and tried moving the fields parts to the middle of the query, but no dice.
I have tried creating a panel in a dashboard using a similar query don't see this happening. I'm using Chrome. Not sure if is caused by the IE browser you use. Could you please try in a different browser?
I'm only permitted to use IE on my work laptop.
This problem is hit and miss for me. I've seen this occur before, but fortunately the issue didn't persist.
We are having the same issue. We primarily use IE as well. I will test in Firefox and Microsoft Edge.