#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
Builder

 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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...