Personally, I'd use Perl. That's because I'm familiar with Perl, and so is the rest of the company I work for. Our software is largely in Perl.
But, that's not really an answer for you. You need to consider:
- How trivial is this problem? If its real trivial ("grab the lines containing FOO"), you can just use
- Is it likely to remain trivial? If its likely to fairly quickly grow non-trivial, then you may just want to skip the trivial solution stage, because you'll just have to re-do it next week.
Let's say its not trivial, then:
- What languages are you familiar with? Production code isn't really a great target for learning a new language.
- What languages are your coworkers familiar with? They're going to have to maintain your program in the future.
- Of your choices, which would be easiest to write the program in? To maintain it?
- Keep in mind which languages have libraries that'd help you out. Make sure to check.
If it turns out that you and all your coworkers know Java, but not Perl, Python, or Ruby then Java might be the right answer—even though Java is, taken alone, less suited to the task. Same if they all know PHP, or even C++.
PS: Editing logs is somewhat weird. You might get more help here if you describe the problem you're trying to solve.