Splunk Search

How to concatenate strings with unicode character?

junlozhang
Explorer

I want to concatenate strings with special characters like "\t" and Unicode char "\u0006"

I tried

 

 

| makeresults 
| eval str="a"."\t"."b"

 

 

And got

 

 

a\tb

 

 

But what I want is

 

 

a  b

 

 

 

Also, I tried

 

 

| makeresults 
| eval str="a"."\u0006"."b"

 

 

And got

 

 

a\u0006b

 

 

 

What should I do?

Labels (1)
Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@junlozhang 

 

Can you please share your use case where and how you want to use?  Just for trial I draft search in sublime using tab key and executed.  If you have specific use case then please share. 

 

| makeresults 
| eval str="a"."	"."b"

 

Screenshot 2021-05-08 at 3.37.00 PM.png

 

Screenshot 2021-05-08 at 3.37.12 PM.png

 

0 Karma

junlozhang
Explorer

@kamlesh_vaghela 

Thanks for the solution about "\t". And what about Unicode character? Does it mean there is no way to concatenate a Unicode character and a string?

Well, the reason I want to do this is that our log system has just switched to Splunk recently, and in order to make as least change as possible to the code of current downstream service, I'm trying to make the data fetched from Splunk has the same schema as the old log system (some fields in Splunk used to be separated by special character "\t" or Unicode character "\u0006")

 

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...