Splunk Search

Splunk doesn't display extra spaces

LearningGuy
Builder

Hello,
Splunk doesn't display extra spaces on variables that I assigned. Please see below example
I used Google Chrome and Microsoft Edge, it gave me same results.  If I exported the CSV, the data have correct number of spaces.
Please suggest. Thank you

 

| makeresults
| fields - _time
| eval One Space = "One space Test"
| eval Two Spaces = "Two  spaces  Test"
| eval Three Spaces = "Three   spaces   Test"

 

 

 

LearningGuy_0-1730923080070.png

 

Labels (1)
0 Karma
1 Solution

johnhuang
Motivator

Format -> Wrap Results 

View solution in original post

johnhuang
Motivator

Format -> Wrap Results 

LearningGuy
Builder

@johnhuang 
Changing the wrap results to Yes fix the problem. Thank you so much for your help

LearningGuy_0-1731072448122.png

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Very astute observation, @johnhuang !  My default is Wrap Results Yes.

wrap-yes.png

Switch to No, and the spacing changes:

wrap-no.png

Not sure what the rationale is for this behavior.

PickleRick
SplunkTrust
SplunkTrust

When you change the "Wrap results" option, it switches between this CSS

.results-table .wrapped-results td,
.results-table .wrapped-results th {
white-space:pre-wrap;
}

and the "nowrap" value.

Instead of "nowrap" it probably should use "preserve-spaces" one to be consistent. (or collapse in both cases).

The mystery of collapsing spaces in the source view which I showed is still present however.

PickleRick
SplunkTrust
SplunkTrust

That is an interesting issue and it's definitely a browser issue.

If I run your search I see the results with proper spacing differences.

PickleRick_0-1730967371939.png

But.

If I go into page source in developer tools I get this:

PickleRick_1-1730967420219.png

They look evenly spaced, right? But they aren't. If I double click on those values to edit them, they "spread" (I think something changes font-wise when you're editing the contents).

So it's definitely something with text rendering on the browser's side.

LearningGuy
Builder

@PickleRick @yuanliu @yuanliu 

So, I did the following tests:
1) User A logged in to Splunk with his user ID using Google Chrome on User A's PC. The result was that Splunk displayed extra spaces correctly using Google Chrome on User A's PC.

2) I login to Splunk with my userID using Google Chrome on my PC. The result was that Splunk does not display extra space correctly using Google Chrome on my PC.

3) User A logged in to Splunk with his user ID using Google Chrome on my PC. The result was that Splunk displayed extra spaces correctly using Google Chrome on my PC. So, it is not an issue with Google Chrome on my PC.

4) I login to Splunk with my userID using Google Chrome on User A's PC. The result was that Splunk does not display extra space correctly using Google Chrome on User A's PC. So, the issue follows my User ID.

The conclusion is: The problem follows my User ID, and it is not an issue with my Google Chrome or my PC. 
I am following up with Splunk.

Assuming I am User B, the issue follows User B:

UserSplunkBrowserPCResult
User AUser AUser AUser ANo Space issue
User BUser BUser BUser BSpace issue
User AUser Buser BUser BNo Space issue
User BUser AUser AUser ASpace issue



Thanks

0 Karma

LearningGuy
Builder

Hi @PickleRick 

Thank you for your response.
I checked the developer tools, and it did show extra spaces on the browser.
The PC support asked me this question "if this is a browser issue, then why did the issue also occur on a different browser?  So, no chance it's a Splunk profile issue?
I already cleared, my cache and it's the same issue.    
The next step is that I will test it using a different PC used by Splunk user that doesn't have this issue

LearningGuy_0-1730992175945.png

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Like @jawahir007 , I cannot reproduce your results.

Screen Shot 2024-11-06 at 8.39.55 PM.png

My instance is 9.3.1.  Whether this is a update issue, Splunk itself does output the correct spacing in the stats table in my browsers, namely Safari 17.6, Chrome 129.0.6668.60, and Firefox 94.0.1.

In short, Splunk does display extra spaces.  Something in your browser's renderer is giving the incorrect display.

LearningGuy
Builder

Hi @yuanliu 

Could it be an issue with my Splunk profile?
I am using Splunk Enterprise Version:9.0.4. My browser is Google Chrome Version 130.0.6723.117 (Official Build) (64-bit) and Microsoft Edge Version 130.0.2849.68 (Official build) (64-bit)

If it's a browser issue, why is it not working on another browser like Microsoft Edge?


Thank you for your help

0 Karma

LearningGuy
Builder

@jawahir007 
I don't have any pending updates. 
If it's a browser issue, then why is it displaying text correctly in the search box, but not on the statistical table in Splunk?   
Thanks

0 Karma

jawahir007
Communicator

Hi, it should work, and it’s working fine on my end. Try upgrading your browser if you have any pending updates.

jawahir007_0-1730924000899.png

 

------

If you find this solution helpful, please consider accepting it and awarding karma points !!
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...