The only solution is to take legal action.

Literal

Only solution [topic-は] law [to-に] appeal thing is.

法に訴える ('to appeal to the law, to take legal action') uses 訴える (うったえる, 'to appeal, to sue'). ことだ nominalizes the action into a predicate. 唯一の (ゆいいつの, 'only, sole') emphasizes exclusivity.