0

Hi I am quite new to JSON, I am struggling with this error unexpected end-


   "variables": {
 "excPaths" : "%windir%\\Security\\Database\\*.chk;%windir%\\Security\\Database\\*.cmtx;%windir%\\Security\\Database\\*.csv;%windir%\\Security\\Database\\*.edb;
 %windir%\\Security\\Database\\*.jrs;%windir%\\Security\\Database\\*.log;%windir%\\Security\\Database\\*.sdb;
 %windir%\\Security\\Database\\*.xml;%windir%\\SoftwareDistribution\\Datastore\\Datastore.edb;%windir%\\SoftwareDistribution\\Datastore\\Logs\\edb.chk;
 %windir%\\SoftwareDistribution\\Datastore\\Logs\\edb*.jrs;%windir%\\SoftwareDistribution\\Datastore\\Logs\\edb*.log;
 %windir%\\SoftwareDistribution\\Datastore\\Logs\\tmp.edb;%windir%\\System32\\GroupPolicy\\Machine\\Registry.pol;%windir%\\System32\\GroupPolicy\\User\\Registry.pol;
 %SystemRoot%\\IS Temporary Compressed Files;%SystemDrive%\\inetpub\\temp\\IIS Temporary Compressed Files;%SystemDrive%\\inetpub\\temp\\ASP Compiled Templates;
 %systemDrive%\\inetpub\\logs;%systemDrive%\\inetpub\\wwwroot;F:\\Program Files\\Microsoft Configuration Manager\\Install.map;
 F:\\Program Files\\Microsoft Configuration Manager\\Logs;F:\\Program Files\\Microsoft Configuration Manager\\MP\\OUTBOXES;
 F:\\Program Files\\SMS\\MP\\OUTBOXES;F:\\Program Files\\SMS_CCM\\Logs;
 F:\\Program Files\\SMS_CCM\\ServiceData;F:\\Program Files\\Microsoft Configuration Manager\\cd.latest;
 F:\\Program Files\\Microsoft Configuration Manager\\EasySetupPayload;F:\\Program Files\\Microsoft Configuration Manager\\AdminUIContentPayload;
 F:\\Program Files\\Microsoft Configuration Manager\\AdminUIContentStaging;F:\\Program Files\\Microsoft Configuration Manager\\CMUStaging;
 F:\\Program Files\\Microsoft Configuration Manager\\CMUClient;F:\\Program Files\\Microsoft Configuration Manager\\PilotingUpgrade;
 F:\\Program Files\\Microsoft Configuration Manager\\RLAStaging;F:\\Program Files\\Microsoft Configuration Manager\\CMProviderLog;
 F:\\Program Files\\Microsoft Configuration Manager\\ISVTemp",
 "excExt" : ".chk;.cmtx;.csv;.edb;.jrs;.log;.sdb;.xml",
 "excProc" : "Smssqlbbkup.exe;Cmupdate.exe;Sitecomp.exe;Smsexec.exe;Smswriter.exe;Ccmexec.exe;w3wp.exe;php-cgi.exe"
   },

I am sure this error is due to long string.Any help or suggestion will be much appreciated.

Please let me know if you require further information

Many thanks,

NSeth
  • 11
  • 8
  • Please add the full error and programming language. – Jeppe Jul 03 '19 at 17:02
  • sorry missed to type the exact error -struggling with the error **unexpected end of string** – NSeth Jul 03 '19 at 17:02
  • 1
    Try reading this: [multiline-strings-in-json](https://stackoverflow.com/questions/2392766/multiline-strings-in-json) – Jeppe Jul 03 '19 at 17:04
  • @Jeppe I have added the error code above and language I am using is JSON, I am trying to write ARM template to add some exception in the anti-malware polices in VM – NSeth Jul 03 '19 at 17:06
  • You have multiline strings. You should either split them into a list or replace the newlines with `\n` characters, as suggested in the link I posted. JSON is also just a format, it doesn't throw exceptions, programming languages that parse JSON do however. Perhaps we could help you more if you showed how you generate the JSON. – Jeppe Jul 03 '19 at 17:11
  • @Jeppe many thanks for your response, I will try as per your suggestions and get back to you. – NSeth Jul 04 '19 at 05:38
  • @jeppe I have through the link as suggested by you and used the `\n` character but still I am getting the same error.May be I am doing something very wrong.On the line two above in my JSON code if I have very long string separated by `;` .How can I use `\n` to avoid multiple line string error.Thanks – NSeth Jul 05 '19 at 00:03
  • Please edit your post and add the JSON and code that throws the error. What language are you using to read the JSON? Oh, and when I wrote "\n characters" I meant both "\" and "n". – Jeppe Jul 05 '19 at 05:49
  • @Jeppe thanks for the link and suggestion it looks like I have fixed the issue.I have to use \r\n – NSeth Jul 06 '19 at 02:38
  • Great - if you could, please update your question with the relevant information - and consider answering your question with the relevant information to solve the problem. This way, future readers with the same problem may find a solution to their problem through this thread. – Jeppe Jul 07 '19 at 17:44

0 Answers0