Moses died presumably around 1410 BCE, and Malachi existed around 430 BCE. During this period of 1000 years, hundreds of prophets came to the Jews, but the Jews/Christians know only a few dozen Hebrew prophets. What’s the reason?
The reason is that God decided that the most appropriate prophets through whom to speak to his people in a written way were Isaiah, Jeremiah, Ezekiel, Daniel, Hosea… Malachi. There were hundreds, and probably thousands of Jews who were considered prophets, but only a few of them contributed significantly to Jewish history. There have been thousands of representatives and senators in the United States, but if we were to write the history of the country, we would only mention a few dozen of them. God is wiser than us about such matters. The Bible is somewhere around 1500 pages, depending on the translation. The Old Testament, is around 1100 pages, give or take. Imagine if God had chosen to let every God-fearing prophet to have a place in the Old Testament! It would probably be more than 10,000 pages. Elijah seems like a good candidate to have his writings in the Jewish Bible. We do not know why God chose not to include anything written by Elijah. The same is true of the New Testament. There were twelve apostle (or 13 if you count Paul and 14 if you count Matthias). Of those, only Peter, John, Matthew and Paul have books in the New Testament. I assume that Jesus could have written some really good material for the Bible, yet God decided not to include anything written by Jesus. I assume that God chose those who were most gifted at writing as the ones whose writings ended up in the New Testament. Luke is an amazing writer and historian, so God chose Luke to write two of the New Testament books. Who knows, maybe Thomas was a great evangelist, but not a very good writer. I am sure that God is much wiser than you or I about whose writings should have ended up in the Bible.
Bottom line, I really do not know specifically why God chose who he chose, but God knows. What I can say for sure is that it definitely would not have made sense for every prophet to have a place in the Old Testament. I also know that the writings which did end up in the Scriptures are all inspired by God.