- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
12-14-2021 02:47 AM - edited 12-14-2021 02:52 AM
Hi All,
I am having issues importing rules from CSV.
I have been trying to get the following to work
name;action;description;from;src;to;destination;app;service
But it just only gets the name, description, from, to fields and the Warnings tab says that the objects put in the other fields do not exist.
It also imports in inital line with the field names.
Opening up the rule I can paste in the objects and it will find them.
Going back to the example from the Guide https://live.paloaltonetworks.com/t5/expedition-articles/a-how-to-guide-on-the-import-csv-option/ta-...
from;to;action;source address;service;destination address;comment
Untrusted;Trusted;allow;sourcehost;any;desthost;test rules for csv import
I created the hosts manually in Expedition before the import.
I can match up the fields and import the above and get 2 rules.
First is the fields list from above with warnings about objects not existing.
It actually puts "from" and "to" in those fields on the policy when you look at it.
Second is that actual rule but again its just the name, description, from, to fields.
Version is 1.2.3 but was also having the same issue on version 1.2.2.
I can import objects just not rules.
12-14-2021 09:32 AM
@ToddThorne The format you provided is correct, one of the common issues we saw are if you edit the file in the excel , it will often added extra character in the line, so you can try open the file using a text editor and make sure there is no extra space or character in the line. Also if the source or destination is not IP , you will need to import the address objects first then import the security rules.
12-14-2021 09:32 AM
@ToddThorne The format you provided is correct, one of the common issues we saw are if you edit the file in the excel , it will often added extra character in the line, so you can try open the file using a text editor and make sure there is no extra space or character in the line. Also if the source or destination is not IP , you will need to import the address objects first then import the security rules.
12-14-2021 01:35 PM - edited 12-14-2021 01:38 PM
Hi @lychiang , so it looks like the issue was the files getting changed.
I spun up an old vm instance of Expedition I had initially trialed out locally running 1.1.113.
Importing the example from my initial post worked fine.
Copying it back to the production box on client site via cut and paste into wordpad (as notepad does not deal well with Unix type LF so it makes editing the import file less painful) and saving as a csv or text file did not work, back to the same issues.
Note this has been working fine for importing objects, which was why I was looking else where.
Copy and paste into a local file, saving and copying the file across to the prod environment to import works as expected.
Editing in notepad on the copied file is cumbersome due to not recognizing end of line characters.
Copy and paste into notepad on prod worked as well without the LF issues.
So thanks for pointing out the obvious, turns out that was really helpful.
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!