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

Exciting News: The AppDynamics Community Joins Splunk!

Hello Splunkers,   I’d like to introduce myself—I’m Ryan, the former AppDynamics Community Manager, and I’m ...

The All New Performance Insights for Splunk

Splunk gives you amazing tools to analyze system data and make business-critical decisions, react to issues, ...

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...