- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
06-30-2024 07:37 PM
Hello,
I'm working with PAN-OS 10.2 and need to set descriptions for various objects like address objects, service objects, and security policies using CLI commands in the set format. I'm struggling to include strings that contain line breaks, single quotes ('), and double quotes ("). Could someone guide me on how to properly format these special characters within the descriptions?
Thank you in advance for your assistance!
07-01-2024 12:50 AM
Hi @a-takamura ,
As far as I know this isn't implemented yet.
However, there's a past discussion on the topic where user @ThomasPaine used a workaround using a benign config stanza:
https://live.paloaltonetworks.com/t5/general-topics/comments-in-cli/td-p/176425
There's also an existing feature request where you can ask your local SE to have your voted added:
FR-ID: NSFR-I-26529
Kind regards,
-Kim.
07-01-2024 03:01 AM
For a comment that contains quotes, you need to package the comment inside single quotes like so:
set address example description '"lazorz"'
but for line breaks i don't think you can do that from CLI at this time
07-01-2024 03:31 AM
Thank you for the clarification regarding quotes. I understand that for descriptions with quotes, I should encapsulate them within single quotes as demonstrated.
However, regarding line breaks, I have another question. In the GUI, it's possible to include line breaks and other free-form text in descriptions for various objects. Is it indeed impossible to do this via the CLI? I assumed there might be escape sequences to handle this, but the following command results in an error:
set rulebase security rules Test-Policy description "This is a \"test policy\".\nThis is a 'new line'."
Could it be that there are no escape sequences available for this purpose in the CLI?
07-02-2024 12:55 AM
as far as i've found there are no escape characters
once you 'encapsulate' any characters inside the quotes is treated as cleartext
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!