How to build Fluent Bit source on macOS

Anuja Arosha
3 min readNov 12, 2020

Hello guys… :) This blog post is about how to build Fluent Bit source in a macOS. Firstly, let me tell you what is Fluent Bit. It is;

an open source and multi-platform Log Processor and Forwarder which allows you to collect data/logs from different sources, unify and send them to multiple destinations.

Before I explain you how to build, let me describe my working environment. The reason for that is, depending on the versions that we are using, the errors you may get can be differ.

  • Fluent Bit version : 1.6.1
  • macOS : Catalina (Version 10.15.7)

The moment you read the heading, you may think why should I read this blog post instead the Fluent Bit documentation. The answer is, official documentation does not describe the dependencies and errors that you will get when you download the source and try to build it straight forward.

You can download the latest Fluent Bit source by visiting this official download page. But it always has the latest version. As an example, by the time when you read this post, it will have more recent version of Fluent Bit instead of 1.6.1.

The first error you might come across when you run the make command is;

missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY.

Therefore, before you build the source, you have to set that environment variable. In my case, I have added that variable in .zshrc file like below.

export MACOSX_DEPLOYMENT_TARGET=10.15

The next dependency is LuaJIT. This you may haven’t installed at all or you may have an older version. Please install the stable latest version before you proceed. You can find the source and install instruction of LuaJIT from it’s official site. Once you installed, just run the following command and you will see a similar output if you have successfully installed it.

luajit -v      
LuaJIT 2.0.5 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/

The third fact that you need to aware of is the Bison package. Fluent Bit is already having opened Github issue for this error. I have followed this tutorial to install Bison on macOS. According to Fluent Bit authors, we need at least Bison 3.3 or upper. Once you installed it, make sure FILEPATH and priority has been set as mentioned here.

OK, now you are good to go and follow the instruction given in official documentation.

But, from my experience, Fluent Bit is still not fully functioning in macOS like in any other compatible Linux OS. I can give an example for that as well. We have an opened Github issue for using rewrite-tag on macOS. But I encourage you to try it on macOS and contribute to the open source project at least by showing the bugs and possible scenarios that they can reproduce those bugs.

Final thoughts, Fluent Bit is better, if the existing functionalities are available on macOS, then it is the best.

--

--

Anuja Arosha

Native mobile application development enthusiasm. DevOps engineer.