Remove tomato skins (if desired), core, and seeds, and chop tomatoes.
Place tomatoes and onion in slow cooker and set to high. Cook approximately 1 hour, until tomatoes have started to break down and the juices are bubbling.
Puree tomatoes using a stick blender or in batches with a blender. Return to slow cooker.
Stir in vinegar, sugar, and salt.
Place remaining spices on a square of cheesecloth and tie into a bundle with kitchen twine. Add to the mixture.
Cook on low, with the lid removed, for approximately 8 hours. Pour into either prepared glass jars for canning, or freezer jars.
Process in a water-bath canner for 15 minutes if canning. If freezing, let cool in freezer jars to room temperature before sealing and moving to freezer.
Depending on desired consistency, you might need to cook for longer.
You may cook on high to reduce to required time, but be sure to keep an eye on the ketchup and stir to prevent sticking or scorching.