Filenames with slashes not updating

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filenames with slashes not updating

Greetings,


So I have been pulling rasterized images with the names of the URLs attached into XSOAR and attempting to pipe them into some ServiceNow tickets, but character restrictions are giving the system issues on what files to call during the upload process.  

The files are stored as the proper URL context, but filenames cannot have slashes in them, so the file names are being edited with underscores in place of the slashes when the files are generated or when you attempt to download said file, but in XSOAR it still thinks of the file as being named with proper URL context including the slashes, so when I go to upload them in other tasks the files are not found.  

I have attempted to replace characters via conditional tasks after the images are generated but the system is limiting me on what contexts I can use to identify them, and I can't seem to pull anything in to transform.  

Any ideas?

MicrosoftTeams-image (3).png

 

MicrosoftTeams-image (4).png

 

MicrosoftTeams-image (5).png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hey @asawyer,

So I finally got it to work.  By moving the re-naming steps into the rasterize process instead of the SN upload process they are finally posing into the ticket with the the full names.

Thanks for all of your help!

View solution in original post

10 REPLIES 10

L2 Linker

Hi @Jersey_Mankowski,

 

It looks like you are passing in the URL to the `file_name` input to `rasterize`. The default filename for the `rasterize` result is simply "url.png". Could you try leaving the `file_name` input blank or passing in a different value instead of the URL?

Hey @asawyer 

The plan is to get the url address in the filename so that when It gets move around or exported to tickets you can tell where the image was from.

Rasterize is working fine with default naming.

L2 Linker

Hey @Jersey_Mankowski – Ah, I'm tracking now. There are a couple of complications here. The first is the replacement of certain characters, as you mentioned in your original post, and the other is a restriction on filename length (on both the XSOAR and ServiceNow side).

 

The see what XSOAR changed the filename to, download the result of rasterize and view the filename.

 

From my testing, the maximum filename length for ServiceNow is 255 characters. So to pass in a valid file_name arg value to servicenow-upload-file:

1. Replace at least the slashes with underscores, so the value is not misinterpreted as a URL (Replace transformer)

 

2. Truncate the value to 251 characters max to leave room for the file extension – You can do this using the RegexGroups transformer with regex:  ^(.{,251})

3. Concat the ".png" file extension

 

Please give that a try and let us know if it works!

 

Screen Shot 2022-05-26 at 3.25.43 PM.png

Hey @asawyer 

I like what you are thinking, and that could be half of it, but with the new transforms I have been seeing an error in the RE.py lib, and some other errors with the replace, I did get it to go through as expected but it's still failing to upload the file and says it does not exist, even when looking up by artifact. 

For reference I am doing the file_name transformations in the !servicenow-upload-file task.  I have also tried a replace on the slashes to underscore directly after the rasterize, but it would never find anything.    I feel like the automatic file renaming by the system is getting these images corrupted or lost somehow, but it's hard to confirm that when I can go download the artifacts. 

 2022-05-27 09_17_31-#116024 [Phish Alert] FW_ [EXTERNAL] Invoice from Qene’s Catering - Work Plan.png2022-05-27 09_41_30-#116024 [Phish Alert] FW_ [EXTERNAL] Invoice from Qene’s Catering - Work Plan.png2022-05-27 10_25_46-#116017 [Phish Alert] FW_ [EXTERNAL] Fitness Center Owners Can Now Claim ERTC Re.png

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!