Yara is a tool which is used to write a rule for detection of malwares whereas CLAMAV is antivirus that has predefined rulesets that is used to detect the malicious software or malware. Today there are various antivirus engines use yara rules to detect malwares. YARA provides simple and efficient way of writing rules. It is more popular because of it can be used through yara-python library. So if you want build your own malware detection framework so you can use it efficiently.