Splunk Search

add multiple spaces for fields

sfatnass
Contributor

hi i want to add multiple space for a fields
i tried to use :
| eval fieldname1= fieldname2 . " " . fieldname3

but splunk show only one space and not more

how can i do to specify more spaces
thx

0 Karma

jotne
Builder

Old question, but needs a better answer 🙂

 

You can use a non-breaking-space  alt 255

Here you have 10 of them between START-END

START          END

 

So if you like nice space between one field combined from two. add enough blank at end and then cut all equally long.

| eval eventid=eventid."                  "
| eval eventid=substr(eventid,1,29)
| eval message1=eventid.message

0 Karma

TStrauch
Communicator

Hi,

the multiple spaces are written to the source code. But html is wrapping multiple whitespaces as one. Its not a problem of splunk its simple html crap.

Means. You have your Spaces in the data. But its not correctly displayed in Browser.

Hope this helps.

Kind regards

woodcock
Esteemed Legend

The same thing happens with newlines inside of the fields (values), too! This frustrates me.

0 Karma

sfatnass
Contributor

TStrauch i think you don't understand my aim.
my objectif :
if x is a space.
| eval fieldname1= fieldname2 . "xxxxxxxx" . fieldname3

0 Karma

TStrauch
Communicator

I understand your aim. And its like i explained to you.

Ok lets try this. Take you | eval fieldname1= fieldname2 . "xxxxxxxx" . fieldname3
Start your search.
klick on the interesting fields and klick on fieldname1
take one of the top 10 values and drill down on it.
Your search string will show the spaces.

Your spaces are in your data. They are simply not displayed correctly.

You have a html problem. there are ways like css options "white-space: pre;" or something to display the white spaces.

0 Karma

TStrauch
Communicator
0 Karma

sfatnass
Contributor

ok but what is the balise can i call on my css to specify for my dashboard
white-space:pre;

i see what do you mean, but have you a solution to resolve within dashboard ?

0 Karma

MaryvonneMB
Path Finder

Maybe use underscores instead of spaces? I'm surprising that you want to use multiple spaces.

0 Karma

sfatnass
Contributor

i only follow the orders

0 Karma

gcusello
SplunkTrust
SplunkTrust

try
| eval fieldname1= fieldname2+" "+fieldname3
Bye.
Giuseppe

0 Karma

sfatnass
Contributor

same way splunk show only one space not more
my objectif :
if x is a space.
| eval fieldname1= fieldname2 . "xxxxxxxx" . fieldname3

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...