#Random
This is a place to discuss all things outside of Splunk, its products, and its use cases.

How do you format code in a question comment?

lukejadamec
Super Champion

I'm seeing folks do it, but I don't see a format button.
If you're working in a Splunk Answers comment field, how do you format text as code?

Tags (1)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

You can simply indent it 4 spaces. You can also enclose it in in backquotes, or you can use the <pre></pre> tags. Help for Markdown is here: http://daringfireball.net/projects/markdown/syntax

View solution in original post

altink
Contributor

 didn't work for me

gkanapathy
Splunk Employee
Splunk Employee

You can simply indent it 4 spaces. You can also enclose it in in backquotes, or you can use the <pre></pre> tags. Help for Markdown is here: http://daringfireball.net/projects/markdown/syntax

lukejadamec
Super Champion

Thanks for the document link. It is good reading, but it is not much help unless I'm looking for a new profession.

0 Karma

lukejadamec
Super Champion

Pooks then?
*%^#!&)*^!!!
mmm
Hoot!

0 Karma

lukejadamec
Super Champion

4 spaces?
%^#!)^!!!
rrr them
*%^#!)*^!!!
stars.

0 Karma

pradeepkumarg
Influencer

embed your code between pre tags < pre > < /pre >

Remove the space inside the tag when you use it.

shartwell
Explorer

Testing 123

0 Karma

shartwell
Explorer

Testing 123

0 Karma

shartwell
Explorer
Testing 123
0 Karma

cblanton
Communicator
Testing 123
 code 
0 Karma

lukejadamec
Super Champion

Thanks, it

%^#!)^

worked!
Except for the *'s, what is up with that? I still have to escape them
*%^#!)*^!!!

stars!

0 Karma

rbechtold
Communicator

test

 | rex field=raw max_match=0 "\s?(?P[A-Za-z-\]+=[^\s]+)" 

0 Karma

lukejadamec
Super Champion
index=saywhat? sourcetype=I\sneed\sto\suse\s.*&%&%\sxml?
0 Karma

govindsinghrawa
Path Finder

let me try

hello world
0 Karma

govindsinghrawa
Path Finder

Eureka!!!!

0 Karma
Get Updates on the Splunk Community!

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

Observability Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestSplunk APM's New Tag Filter ExperienceSplunk APM has updated ...

Security Newsletter Updates | March 2023

 March 2023 | Check out the latest and greatestUnify Your Security Operations with Splunk Mission Control The ...