#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 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...